Problem 3nplus1
User SMILE
Submission Time 2024-04-13 11:42:02
Score 0
Max Time N/A
Max Memory N/A

Compile Error

3nplus1.cpp: In function ‘int main()’:
3nplus1.cpp:8:9: error: expected ‘;’ before ‘if’
8 | cin>>n
| ^
| ;
9 | if(n%2=0){
| ~~
3nplus1.cpp:11:4: error: ‘else’ without a previous ‘if’
11 | }else if(n%2=1){
| ^~~~
3nplus1.cpp:11:16: error: lvalue required as left operand of assignment
11 | }else if(n%2=1){
| ^
3nplus1.cpp:12:10: error: unable to find numeric literal operator ‘operator""n’
12 | cout<<3n+1;
| ^~
3nplus1.cpp:15:3: error: ‘sum’ was not declared in this scope
15 | sum = sum + x;
| ^~~
3nplus1.cpp:15:15: error: ‘x’ was not declared in this scope
15 | sum = sum + x;
| ^
3nplus1.cpp:17:8: error: ‘sum’ was not declared in this scope
17 | cout<<sum;
| ^~~