Problem sumint
User Jiayue
Submission Time 2023-11-10 11:10:24
Score 0
Max Time N/A
Max Memory N/A

Compile Error

sumint.cpp: In function ‘int main()’:
sumint.cpp:6:9: error: ‘n’ was not declared in this scope
6 | cin >> n;
| ^
sumint.cpp:8:12: error: expected ‘)’ before ‘;’ token
8 | cin >> a;
| ^
| )
sumint.cpp:7:6: note: to match this ‘(’
7 | for (int i = 1; i <=n;
| ^
sumint.cpp: At global scope:
sumint.cpp:11:4: error: ‘cout’ does not name a type
11 | cout << sum;
| ^~~~
sumint.cpp:12:4: error: expected declaration before ‘}’ token
12 | }
| ^