Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
157898 格林老师 A+B 输入输出练习IV C++ Compile Error 0 MS 0 KB 556 2026-08-18 22:19:09

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n){ int sumi=0#include<bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n){ int sumi=0; int a[n]; if (n==0){ break; } for (int i=0;i<n;i++){ cin>>a[i]; sumi+=i; } cout<<sumi; } return 0; } int a[n]; if (n==0){ break; } for (int i=0;i<n;i++){ } } return 0; }


Run Info:

Main.cc:6:19: error: stray '#' in program
         int sumi=0#include
                   ^
Main.cc: In function 'int main()':
Main.cc:6:20: error: expected ',' or ';' before 'include'
         int sumi=0#include
                    ^
Main.cc:8:11: error: a function-definition is not allowed here before '{' token
 int main(){
           ^
Main.cc:33:1: error: expected '}' at end of input
 }
 ^
Main.cc:6:13: warning: unused variable 'sumi' [-Wunused-variable]
         int sumi=0#include
             ^
Main.cc:33:1: error: expected '}' at end of input
 }
 ^