Problem 3nplus1
User ethantanaki
Submission Time 2026-02-28 10:14:46
Score 0
Max Time N/A
Max Memory N/A

Compile Error

3nplus1.cpp:3:5: error: cannot declare ‘::main’ to be a global variable
3 | int main {
| ^~~~
3nplus1.cpp:4:2: error: expected primary-expression before ‘int’
4 | int n;
| ^~~
3nplus1.cpp:4:2: error: expected ‘}’ before ‘int’
3nplus1.cpp:3:10: note: to match this ‘{’
3 | int main {
| ^
3nplus1.cpp:5:2: error: ‘cin’ does not name a type; did you mean ‘sin’?
5 | cin >> n;
| ^~~
| sin
3nplus1.cpp:6:2: error: expected unqualified-id before ‘while’
6 | while(n != 0) {
| ^~~~~
3nplus1.cpp:15:1: error: expected declaration before ‘}’ token
15 | }
| ^