Problem evenorodd
User playiprobro
Submission Time 2024-02-04 23:42:43
Score 0
Max Time N/A
Max Memory N/A

Compile Error

evenorodd.cpp:3:5: error: cannot declare ‘::main’ to be a global variable
3 | int main{
| ^~~~
evenorodd.cpp:4:2: error: expected primary-expression before ‘int’
4 | int x;
| ^~~
evenorodd.cpp:4:2: error: expected ‘}’ before ‘int’
evenorodd.cpp:3:9: note: to match this ‘{’
3 | int main{
| ^
evenorodd.cpp:5:7: error: ‘cin’ in namespace ‘std’ does not name a type
5 | std::cin >> x;
| ^~~
In file included from evenorodd.cpp:1:
/usr/include/c++/9/iostream:60:18: note: ‘std::cin’ declared here
60 | extern istream cin; /// Linked to standard input
| ^~~
evenorodd.cpp:6:2: error: expected unqualified-id before ‘if’
6 | if (x%2 == 1){
| ^~
evenorodd.cpp:8:3: error: expected unqualified-id before ‘else’
8 | }else{
| ^~~~
evenorodd.cpp:11:1: error: expected declaration before ‘}’ token
11 | }
|