Problem staircase
User Zixuan
Submission Time 2023-12-04 11:13:13
Score 0
Max Time N/A
Max Memory N/A

Compile Error

staircase.cpp:3:5: error: cannot declare ‘::main’ to be a global variable
3 | int main{
| ^~~~
staircase.cpp:4:2: error: expected primary-expression before ‘int’
4 | int n;
| ^~~
staircase.cpp:4:2: error: expected ‘}’ before ‘int’
staircase.cpp:3:9: note: to match this ‘{’
3 | int main{
| ^
staircase.cpp:5:2: error: ‘cin’ does not name a type; did you mean ‘sin’?
5 | cin >> n;
| ^~~
| sin
staircase.cpp:6:8: error: ‘n’ was not declared in this scope; did you mean ‘yn’?
6 | int c[n];
| ^
| yn
staircase.cpp:7:2: error: expected unqualified-id before ‘for’
7 | for(int i=0;i<n;i++) cin>>c[i];
| ^~~
staircase.cpp:7:14: error: ‘i’ does not name a type
7 | for(int i=0;i<n;i++) cin>>c[i];
| ^
staircase.cpp:7:18: error: ‘i’ does not name a type
7 | for(int i=0;i<