/ MYOJ /

记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:6:29: error: 'a' was not declared in this scope
  for(int i=1;i<=n;i++) cin>>a[i];
                             ^
foo.cc:12:25: error: 'ans' was not declared in this scope
   for(int i=a;i<=b;i++) ans+=a[i];
                         ^~~
foo.cc:12:25: note: suggested alternative: 'abs'
   for(int i=a;i<=b;i++) ans+=a[i];
                         ^~~
                         abs
foo.cc:12:33: error: invalid types 'int[int]' for array subscript
   for(int i=a;i<=b;i++) ans+=a[i];
                                 ^
foo.cc:13:9: error: 'ans' was not declared in this scope
   cout<<ans<<endl;
         ^~~
foo.cc:13:9: note: suggested alternative: 'abs'
   cout<<ans<<endl;
         ^~~
         abs
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1001 乱七八糟(第一弹)
语言
C++
递交时间
2021-08-27 16:23:33
评测时间
2021-08-27 16:23:33
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes