Problem lunchbox
User yq
Submission Time 2026-06-24 21:06:33
Score 0
Max Time N/A
Max Memory N/A

Compile Error

lunchbox.cpp: In function ‘int main()’:
lunchbox.cpp:12:3: error: expected ‘,’ or ‘;’ before ‘int’
12 | int count = 0;
| ^~~
lunchbox.cpp:14:25: error: expected initializer before ‘-’ token
14 | if(int curLunchBoxes - k[i] >= 0 ) {
| ^
lunchbox.cpp:14:24: error: expected ‘)’ before ‘-’ token
14 | if(int curLunchBoxes - k[i] >= 0 ) {
| ~ ^~
| )
lunchbox.cpp:16:19: error: invalid operands of types ‘<unresolved overloaded function type>’ and ‘int’ to binary ‘operator+’
16 | count = count + 1
| ~~~~~~^~~
lunchbox.cpp:22:10: error: no match for ‘operator<<’ (operand types are ‘std::ostream’ {aka ‘std::basic_ostream<char>’} and ‘<unresolved overloaded function type>’)
22 | cout << count << "\n";
| ~~~~~^~~~~~~~
In file included from /usr/include/c++/