Problem 3nplus1
User Hunchbacker9000
Submission Time 2024-02-23 11:07:12
Score 0
Max Time N/A
Max Memory N/A

Compile Error

3nplus1.cpp:3:5: error: cannot declare ‘::main’ to be a global variable
3 | int main {
| ^~~~
3nplus1.cpp:5:2: error: expected primary-expression before ‘int’
5 | int n = 0;
| ^~~
3nplus1.cpp:5:2: error: expected ‘}’ before ‘int’
3nplus1.cpp:3:10: note: to match this ‘{’
3 | int main {
| ^
3nplus1.cpp:7:7: error: ‘cin’ in namespace ‘std’ does not name a type
7 | std::cin >> n;
| ^~~
In file included from 3nplus1.cpp:1:
/usr/include/c++/9/iostream:60:18: note: ‘std::cin’ declared here
60 | extern istream cin; /// Linked to standard input
| ^~~
3nplus1.cpp:9:2: error: expected unqualified-id before ‘while’
9 | while (n != 1 and n <= 10000 ) {
| ^~~~~
3nplus1.cpp:26:2: error: expected unqualified-id before ‘if’
26 | if (n==1) {
| ^~
3nplus1.cpp:32:2: error: expected unqualified-id before ‘return’