Problem staircase
User Daddy
Submission Time 2023-12-02 13:17:13
Score 0
Max Time N/A
Max Memory N/A

Compile Error

staircase.cpp: In function ‘int main()’:
staircase.cpp:11:9: error: request for member ‘begin’ in ‘a’, which is of non-class type ‘int [n]’
11 | sort(a.begin(), a.end());
| ^~~~~
staircase.cpp:11:20: error: request for member ‘end’ in ‘a’, which is of non-class type ‘int [n]’
11 | sort(a.begin(), a.end());
| ^~~
staircase.cpp:12:2: error: ‘j’ was not declared in this scope
12 | j=0;
| ^
staircase.cpp:14:10: error: condition declares an array
14 | if(int a[i]==j){
| ^
staircase.cpp:16:16: error: condition declares an array
16 | }else if(int a[i]==j+1){
| ^
staircase.cpp:21:16: error: expected ‘}’ at end of input
21 | }cout<<j<<endl;
| ^
staircase.cpp:4:11: note: to match this ‘{’
4 | int main(){
| ^