Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
142640 傻逼小安 A+B 输入输出练习IV C++ Compile Error 0 MS 0 KB 441 2026-01-11 14:57:38

Tests(0/0):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,a; while(scanf("%d",&n){ int sum=0; for(int i=0;i<n;i++){ scanf("%d",&a); sum+=a; } printf("%d\n",sum); } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:10:25: error: expected ')' before '{' token
     while(scanf("%d",&n){
                         ^
Main.cc:13:23: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&a);
                       ^