Problem exam
User yueyang
Submission Time 2024-02-16 23:45:28
Score 0
Max Time N/A
Max Memory N/A

Compile Error

exam.cpp:4:5: error: cannot declare ‘::main’ to be a global variable
4 | int main {
| ^~~~
exam.cpp:5:2: error: expected primary-expression before ‘int’
5 | int x, a, b;
| ^~~
exam.cpp:5:2: error: expected ‘}’ before ‘int’
exam.cpp:4:10: note: to match this ‘{’
4 | int main {
| ^
exam.cpp:6:2: error: ‘cin’ does not name a type; did you mean ‘sin’?
6 | cin >> x;
| ^~~
| sin
exam.cpp:7:2: error: expected unqualified-id before ‘if’
7 | if (x == 1) {
| ^~
exam.cpp:10:2: error: expected unqualified-id before ‘else’
10 | else if (x == 2) {
| ^~~~
exam.cpp:15:2: error: expected unqualified-id before ‘else’
15 | else {
| ^~~~
exam.cpp:18:2: error: expected unqualified-id before ‘return’
18 | return 0;
| ^~~~~~
exam.cpp:19:1: error: expected declaration before ‘}’ token
19 | }
| ^