Problem lunchbox
User foodaholic
Submission Time 2024-07-02 21:00:57
Score 0
Max Time N/A
Max Memory N/A

Compile Error

lunchbox.cpp: In function ‘int lunchbox(long int, std::vector<long int>&)’:
lunchbox.cpp:6:5: error: ‘sort’ was not declared in this scope; did you mean ‘qsort’?
6 | sort(school.begin(), school.end());
| ^~~~
| qsort
lunchbox.cpp: In function ‘int main()’:
lunchbox.cpp:29:23: error: no match for ‘operator>>’ (operand types are ‘std::basic_istream<char>::__istream_type’ {aka ‘std::basic_istream<char>’} and ‘const char [2]’)
29 | cin>>school[i]>>"\n";
| ^~~~~~
| |
| const char [2]
In file included from /usr/include/c++/9/iostream:40,
from lunchbox.cpp:1:
/usr/include/c++/9/istream:168:7: note: candidate: ‘std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_tra