Problem 3nplus1
User ZacharyTan2010
Submission Time 2024-02-05 16:09:09
Score 0
Max Time N/A
Max Memory N/A

Compile Error

3nplus1.cpp: In function ‘int main()’:
3nplus1.cpp:4:7: error: ‘cin’ was not declared in this scope
4 | int x;cin>>x;cout<<x;
| ^~~
3nplus1.cpp:1:1: note: ‘std::cin’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
+++ |+#include <iostream>
1 | using namespace std;
3nplus1.cpp:4:14: error: ‘cout’ was not declared in this scope
4 | int x;cin>>x;cout<<x;
| ^~~~
3nplus1.cpp:4:14: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
3nplus1.cpp:6:11: error: expected ‘;’ before ‘}’ token
6 | else{x=x/2}
| ^
| ;
3nplus1.cpp:7:10: error: expected primary-expression before ‘)’ token
7 | if(x!=1;){cout<<" ";}}
| ^