Problem hamster1
User Curiocodeexplorer
Submission Time 2023-11-15 13:25:35
Score 0
Max Time N/A
Max Memory N/A

Compile Error

hamster1.cpp: In function ‘int main()’:
hamster1.cpp:10:37: error: expected ‘;’ before ‘dp’
10 | for (int i=0; i<n; i++) cin>>arr[i]
| ^
| ;
11 | dp[0]=0
| ~~
hamster1.cpp:12:16: error: ‘i’ was not declared in this scope
12 | for (int i=1; i<n; i++){
| ^
hamster1.cpp:20:12: error: ‘temp’ was not declared in this scope
20 | dp[i] = temp;
| ^~~~
hamster1.cpp: At global scope:
hamster1.cpp:22:10: error: ‘cout’ does not name a type
22 | cout << dp[n-1];
| ^~~~
hamster1.cpp:23:4: error: expected unqualified-id before ‘return’
23 | return 0
| ^~~~~~
hamster1.cpp:24:4: error: expected declaration before ‘}’ token
24 | }
| ^