Problem | 3nplus1 |
---|---|
User | godex |
Submission Time | 2025-09-01 16:43:23 |
Score | 0 |
Max Time | N/A |
Max Memory | N/A |
Owl Get a Life
3nplus1.cpp: In function ‘int32_t main()’:
3nplus1.cpp:8:14: error: lvalue required as left operand of assignment
8 | if (n % 2 = 0){
| ^
3nplus1.cpp:9:10: error: expected ‘;’ before ‘cout’
9 | n = n/2
| ^
| ;
10 | cout >> n;
| ~~~~
3nplus1.cpp:13:3: error: ‘else’ without a previous ‘if’
13 | else cout >> 3 * n + 1;
| ^~~~
3nplus1.cpp:13:13: error: no match for ‘operator>>’ (operand types are ‘std::ostream’ {aka ‘std::basic_ostream<char>’} and ‘long long int’)
13 | else cout >> 3 * n + 1;
| ~~~~ ^~ ~~~~~~~~~
| | |
| | long long int
| std::ostream {aka std::basic_ostream<char>}
3nplus1.cpp:13:13: note: candidate: ‘operator>>(int, long long int)’ <built-in>
13 | else cout >> 3 * n + 1;
|