Problem exam
User solomon
Submission Time 2026-06-28 10:12:51
Score 0
Max Time N/A
Max Memory N/A

Compile Error

exam.cpp: In function ‘int main()’:
exam.cpp:4:2: error: ‘cin’ was not declared in this scope; did you mean ‘std::cin’?
4 | cin>>x>>
| ^~~
| std::cin
In file included from exam.cpp:1:
/usr/include/c++/9/iostream:60:18: note: ‘std::cin’ declared here
60 | extern istream cin; /// Linked to standard input
| ^~~
exam.cpp:5:2: error: expected primary-expression before ‘if’
5 | if (x == 1){
| ^~
exam.cpp:8:2: error: ‘else’ without a previous ‘if’
8 | else if(x == 2){
| ^~~~