Problem pythonlist
User jerrielchangjiebin
Submission Time 2026-08-03 17:20:12
Score 0
Max Time N/A
Max Memory N/A

Compile Error

pythonlist.cpp: In function ‘int main()’:
pythonlist.cpp:16:11: error: request for member ‘push_back’ in ‘a’, which is of non-class type ‘std::vector<int>()’
16 | a.push_back(x);
| ^~~~~~~~~
pythonlist.cpp:21:15: error: request for member ‘size’ in ‘a’, which is of non-class type ‘std::vector<int>()’
21 | if (a.size()==0){
| ^~~~
pythonlist.cpp:25:21: error: expected primary-expression before ‘:’ token
25 | cout<<a[:-1];
| ^
pythonlist.cpp:25:21: error: expected ‘]’ before ‘:’ token
25 | cout<<a[:-1];
| ^
| ]
pythonlist.cpp:26:13: error: ‘numbers’ was not declared in this scope
26 | numbers.pop_back();
| ^~~~~~~
pythonlist.cpp:29:3: error: expected ‘}’ at end of input
29 | }
| ^
pythonlist.cpp:5