Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
144003 张晓冉 A+B 输入输出练习IV C++ Compile Error 0 MS 0 KB 299 2026-01-18 10:59:51

Tests(0/0):


Code:

#include<iostream> using namespace std; int main() { int N; while(cin>>N){ if(N = 0){ break; } int num <<endl; for(int i = 0;i < N;i++){ cin>>num; sum += num; } cout<<sum<<endl; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:7:14: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
      if(N = 0){
              ^
Main.cc:10:17: error: expected initializer before '<<' token
         int num <>num;
               ^
Main.cc:13:13: error: 'sum' was not declared in this scope
             sum += num;
             ^
Main.cc:15:15: error: 'sum' was not declared in this scope
         cout<