Problem sumint
User qwerty
Submission Time 2026-02-28 09:21:25
Score 0
Max Time N/A
Max Memory N/A

Compile Error

sumint.cpp: In function ‘int main()’:
sumint.cpp:6:7: error: found ‘:’ in nested-name-specifier, expected ‘::’
6 | int n:
| ^
| ::
sumint.cpp:6:6: error: ‘n’ has not been declared
6 | int n:
| ^
sumint.cpp:7:6: error: qualified-id in declaration before ‘>>’ token
7 | cin >> n;
| ^~
sumint.cpp:8:10: error: ‘n’ was not declared in this scope; did you mean ‘yn’?
8 | int num[n];
| ^
| yn
sumint.cpp:11:8: error: ‘num’ was not declared in this scope; did you mean ‘sum’?
11 | cin>>num[i];
| ^~~
| sum
sumint.cpp:14:10: error: ‘num’ was not declared in this scope; did you mean ‘sum’?
14 | sum += num[i];
| ^~~
| sum