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