Problem | 3nplus1 |
---|---|
User | Denzio321 |
Submission Time | 2023-02-01 16:27:19 |
Score | 0 |
Max Time | N/A |
Max Memory | N/A |
Owl Get a Life
3nplus1.cpp: In function ‘int main()’:
3nplus1.cpp:4:56: error: break statement not within loop or switch
4 | int main() {int n;cin >> n;bool run =true; if (n == 1){break;} while(run) {cout << n << "";if (n%2==0){n = n/2;} else{n=3*n+1}}
| ^~~~~
3nplus1.cpp:4:126: error: expected ‘;’ before ‘}’ token
4 | int main() {int n;cin >> n;bool run =true; if (n == 1){break;} while(run) {cout << n << "";if (n%2==0){n = n/2;} else{n=3*n+1}}
| ^
| ;
3nplus1.cpp:4:127: error: expected ‘}’ at end of input
4 | int main() {int n;cin >> n;bool run =true; if (n == 1){break;} while(run) {cout << n <