Problem sumofdigits
User lixinpei123
Submission Time 2024-11-11 13:33:24
Score 0
Max Time N/A
Max Memory N/A

Compile Error

sumofdigits.cpp: In function ‘int main()’:
sumofdigits.cpp:6:12: error: expected ‘;’ before ‘int’
6 | n = abs(n)
| ^
| ;
7 | int sum = 0;
| ~~~
sumofdigits.cpp:9:3: error: ‘sum’ was not declared in this scope
9 | sum = sum + n%10;
| ^~~
sumofdigits.cpp:12:10: error: ‘sum’ was not declared in this scope
12 | cout << sum;
| ^~~