Problem rollercoaster
User ye
Submission Time 2025-06-20 15:23:47
Score 0
Max Time N/A
Max Memory N/A

Compile Error

rollercoaster.cpp: In function ‘int main()’:
rollercoaster.cpp:7:16: error: ‘i’ was not declared in this scope
7 | long long arr[i];
| ^
rollercoaster.cpp:10:10: error: ‘arr’ was not declared in this scope
10 | cin >> arr[i];
| ^~~
rollercoaster.cpp:15:21: error: ‘arr’ was not declared in this scope
15 | curarr.push_back(arr[i+no]));
| ^~~
rollercoaster.cpp:19:34: error: expected ‘;’ before ‘while’
19 | cout << curarr.back()-curarr[0]
| ^
| ;
20 | while (no--){
| ~~~~~