Problem lunchbox
User Akshar
Submission Time 2024-06-20 14:32:10
Score 0
Max Time N/A
Max Memory N/A

Compile Error

lunchbox.cpp: In function ‘int main()’:
lunchbox.cpp:17:2: error: expected initializer before ‘for’
17 | for(int i=0;i<m;i++){
| ^~~
lunchbox.cpp:17:14: error: ‘i’ was not declared in this scope
17 | for(int i=0;i<m;i++){
| ^
lunchbox.cpp:20:7: error: ‘arr’ was not declared in this scope
20 | sort(arr,arr+m);
| ^~~
lunchbox.cpp:21:17: error: ‘k’ was not declared in this scope
21 | for (int i=0;i<k;i++){
| ^
lunchbox.cpp:24:9: error: no match for ‘operator>>’ (operand types are ‘std::ostream’ {aka ‘std::basic_ostream<char>’} and ‘int’)
24 | cout >> i-1;
| ~~~~ ^~ ~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
lunchbox.cpp:24:9: note: candidate: ‘operator>>(int, int)’ <built-in>
24 | cout >> i-1;
| ~~~~~^~~~~~
l