Problem lunchbox
User Arjunironman8
Submission Time 2026-06-23 16:50:54
Score 0
Max Time N/A
Max Memory N/A

Compile Error

lunchbox.cpp: In function ‘int main()’:
lunchbox.cpp:12:3: error: expected initializer before ‘cin’
12 | cin>>n>>m;
| ^~~
lunchbox.cpp:14:21: error: ‘m’ was not declared in this scope
14 | for(int i = 0; i < m; i++){
| ^
lunchbox.cpp:18:19: error: ‘m’ was not declared in this scope
18 | for(int i = 0; i<m; i++){
| ^
lunchbox.cpp:19:12: error: expected ‘;’ before ‘if’
19 | n -= a[i]
| ^
| ;
20 | if(n<0){break;
| ~~
lunchbox.cpp:22:2: error: ‘ans’ was not declared in this scope; did you mean ‘abs’?
22 | ans++
| ^~~
| abs
lunchbox.cpp:24:9: error: ‘ans’ was not declared in this scope; did you mean ‘abs’?
24 | count<<ans;
| ^~~
| abs