Problem potionseasy
User GrainOrBread
Submission Time 2025-01-24 11:07:30
Score 0
Max Time N/A
Max Memory N/A

Compile Error

potionseasy.cpp:48:4: error: expected unqualified-id before ‘if’
48 | if (arr[i]<0) {
| ^~
potionseasy.cpp:51:4: error: ‘curr_health’ does not name a type
51 | curr_health += arr[i];
| ^~~~~~~~~~~
potionseasy.cpp:52:4: error: ‘curr_potions’ does not name a type
52 | curr_potions += 1;
| ^~~~~~~~~~~~
potionseasy.cpp:53:3: error: expected declaration before ‘}’ token
53 | }
| ^
potionseasy.cpp:55:2: error: expected declaration before ‘}’ token
55 | }
| ^
potionseasy.cpp:56:2: error: ‘cout’ does not name a type
56 | cout << curr_potions << "\n";
| ^~~~
potionseasy.cpp:57:2: error: expected unqualified-id before ‘return’
57 | return 0;
| ^~~~~~
potionseasy.cpp:58:1: error: expected declaration before ‘}’ token
58 | }
| ^