Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
142858 张晓冉 A+B 输入输出练习II C++ Compile Error 0 MS 0 KB 253 2026-01-11 16:37:56

Tests(0/0):


Code:

#include<iostream> using namespace std; int main() { int N; cin>>N; int a,b; int s = 0; int d = 0 for(int i = 0;i <= N;i++){ cin>>a>>b; s = a+b; } cout<<s<<endl; s = 0 return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:10:5: error: expected ',' or ';' before 'for'
     for(int i = 0;i <= N;i++){
     ^
Main.cc:10:19: error: 'i' was not declared in this scope
     for(int i = 0;i <= N;i++){
                   ^
Main.cc:16:5: error: expected ';' before 'return'
     return 0;
     ^
Main.cc:7:9: warning: unused variable 'a' [-Wunused-variable]
     int a,b;
         ^
Main.cc:7:11: warning: unused variable 'b' [-Wunused-variable]
     int a,b;
           ^
Main.cc:9:9: warning: unused variable 'd' [-Wunused-variable]
     int d = 0
         ^