记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:11:14: error: 'sum' was not declared in this scope
  scanf("%d",&sum);
              ^~~
foo.cc:11:14: note: suggested alternative: 'nums'
  scanf("%d",&sum);
              ^~~
              nums
foo.cc:12:20: error: expected primary-expression before ';' token
  for(int i = 0; i< ; i++) {
                    ^
foo.cc:15:22: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'int' [-Wformat=]
     scanf("%d %d",i,j);
                      ^
foo.cc:15:22: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'int' [-Wformat=]
foo.cc:8:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",nums+i);
   ~~~~~^~~~~~~~~~~~~
foo.cc:15:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d",i,j);
     ~~~~~^~~~~~~~~~~~~
自豪的采用HydroJudge(https://github.com/hydro-dev/Hydro)进行评测。

信息

递交者
类型
自测
题目
P1000 两数之和
语言
C++
递交时间
2021-04-19 18:51:35
评测时间
2021-04-19 18:51:35
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes