Problem 3nplus1
User Guest1234
Submission Time 2026-03-18 16:16:56
Score 0
Max Time N/A
Max Memory N/A

Compile Error

3nplus1.cpp: In function ‘int main()’:
3nplus1.cpp:5:17: error: expected ‘;’ before ‘if’
5 | int x; cin >> x
| ^
| ;
6 | if (x%2 == 1){
| ~~
3nplus1.cpp:9:2: error: ‘else’ without a previous ‘if’
9 | else{
| ^~~~
3nplus1.cpp:10:10: error: expected ‘;’ before ‘}’ token
10 | x = x/2
| ^
| ;
11 | }
| ~
3nplus1.cpp:12:11: error: expected ‘;’ before ‘}’ token
12 | cout << x
| ^
| ;
13 | }
| ~