Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
93582 陈铎文 A+B 输入输出练习V C++ Compile Error 0 MS 0 KB 325 2024-10-18 13:15:59

Tests(0/0):


Code:

#include<iostream> using namespace std; int main(){ int a[101]={} int m,s=0; cin>>m; for(int i=1;i<=m;i++){ s=0; cin>>m for(int i=1;i<=m;i++){ cin>>a[i]; s+=a[i]; } cout<<s; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:5:5: error: expected ',' or ';' before 'int'
     int m,s=0;
     ^
Main.cc:6:14: error: 'm' was not declared in this scope
         cin>>m;
              ^
Main.cc:8:12: error: 's' was not declared in this scope
            s=0;
            ^
Main.cc:10:32: error: expected ';' before ')' token
            for(int i=1;i<=m;i++){
                                ^
Main.cc:4:9: warning: unused variable 'a' [-Wunused-variable]
     int a[101]={}
         ^