Problem trains
User Dolphy
Submission Time 2023-09-09 13:09:12
Score 0
Max Time N/A
Max Memory N/A

Compile Error

trains.cpp:3:35: error: use of parameter outside function body before ‘+’ token
3 | void calculate(int n, int height[n+2], int cost[n+2], int index){
| ^
trains.cpp:3:38: error: expected ‘)’ before ‘,’ token
3 | void calculate(int n, int height[n+2], int cost[n+2], int index){
| ~ ^
| )
trains.cpp:3:40: error: expected unqualified-id before ‘int’
3 | void calculate(int n, int height[n+2], int cost[n+2], int index){
| ^~~
trains.cpp:11:5: error: expected initializer before ‘int’
11 | int n;
| ^~~
trains.cpp:12:2: error: ‘cin’ does not name a type
12 | cin >> n;
| ^~~
trains.cpp:13:13: error: ‘n’ was not declared in this scope
13 | int height[n+2], cost[n+2];
| ^
trains.cpp:13:24: error: ‘n’ was not