Problem sumint
User mingze
Submission Time 2026-06-23 06:22:00
Score 0
Max Time N/A
Max Memory N/A

Compile Error

sumint.cpp: In function ‘int main()’:
sumint.cpp:3:13: error: expected primary-expression before ‘long’
3 | #define int long long
| ^~~~
sumint.cpp:10:3: note: in expansion of macro ‘int’
10 | int sum = 0
| ^~~
sumint.cpp:11:20: error: ‘i’ was not declared in this scope; did you mean ‘di’?
11 | while (int i = 0; i < d; i++);
| ^
| di
sumint.cpp:12:6: error: redeclaration of ‘long long int di’
12 | int di;
| ^~
sumint.cpp:7:6: note: ‘long long int di’ previously declared here
7 | int di;
| ^~
sumint.cpp:14:2: error: ‘sum’ was not declared in this scope
14 | sum += di;
| ^~~
sumint.cpp: At global scope:
sumint.cpp:16:1: error: ‘cout’ does not name a type
16 | cout << sum;
| ^~~~
sumint.cpp:17:1: error: expected unqualified-id before ‘return’
17 | return 0;