Problem sumint
User luoxindi09
Submission Time 2023-09-03 20:39:21
Score 0
Max Time N/A
Max Memory N/A

Compile Error

sumint.cpp: In function ‘int32_t main()’:
sumint.cpp:9:2: error: template placeholder type ‘array<...auto...>’ must be followed by a simple declarator-id
9 | array a[d];
| ^~~~~
In file included from /usr/include/c++/9/tuple:39,
from /usr/include/c++/9/functional:54,
from /usr/include/c++/9/pstl/glue_algorithm_defs.h:13,
from /usr/include/c++/9/algorithm:71,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
from sumint.cpp:1:
/usr/include/c++/9/array:94:12: note: ‘template<class _Tp, long unsigned int _Nm> struct std::array’ declared here
94 | struct array
| ^~~~~
sumint.cpp:10:33: error: ‘a’ was not declared in this scope
10 | for (int i=0; i<d; i++) cin >> a[i]; total += a[i];
| ^
sumint.cpp:10:48: error: ‘a’ was not declared in this scope
1