Problem 3nplus1
User Water
Submission Time 2023-06-26 10:56:23
Score 0
Max Time N/A
Max Memory N/A

Compile Error

3nplus1.cpp: In function ‘int main()’:
3nplus1.cpp:6:11: error: invalid conversion from ‘unsigned int*’ to ‘int*’ [-fpermissive]
6 | int *p = &n;
| ^~
| |
| unsigned int*
3nplus1.cpp:7:8: error: expected ‘(’ before ‘true’
7 | while true {
| ^~~~
| (
3nplus1.cpp:7:12: error: expected ‘)’ before ‘{’ token
7 | while true {
| ~~~~^~
| )
3nplus1.cpp:8:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
8 | if (p!=1) {
| ^
3nplus1.cpp:9:9: error: invalid operands of types ‘int*’ and ‘int’ to binary ‘operator%’
9 | if (p%2==1||p%2==-1) {
| ~^~
| | |
| | int
| int*
3nplus1.cpp:9:17: error: invalid operands of types ‘int*’ and ‘int’ to binary ‘operator%’
9 | if (p%2==1||p%2==-1) {
|