Problem | swapsort |
---|---|
User | YH |
Submission Time | 2024-02-01 19:25:55 |
Score | 0 |
Max Time | N/A |
Max Memory | N/A |
Owl Get a Life
swapsort.cpp: In function ‘bool checkSorted(int)’:
swapsort.cpp:7:10: error: invalid types ‘int[int]’ for array subscript
7 | if (p[e] > p[e+1]) {
| ^
swapsort.cpp:7:19: error: invalid types ‘int[int]’ for array subscript
7 | if (p[e] > p[e+1]) {
| ^
swapsort.cpp: In function ‘int main()’:
swapsort.cpp:20:5: error: structured binding declaration cannot have type ‘int’
20 | int[n] p;
| ^~~
swapsort.cpp:20:5: note: type must be cv-qualified ‘auto’ or reference to cv-qualified ‘auto’
swapsort.cpp:20:6: error: conflicting declaration ‘auto n’
20 | int[n] p;
| ^
swapsort.cpp:16:8: note: previous declaration as ‘int n’
16 | int t,n;
| ^
swapsort.cpp:20:9: error: expected initializer before ‘p’
20 | int[n] p;
| ^
swapsort.cpp:25:3: error: ‘p’ was not declared in this scope
25 | p[a] = b;
| ^