Problem lengthsort
User YH
Submission Time 2024-05-27 15:53:36
Score 0
Max Time N/A
Max Memory N/A

Compile Error

lengthsort.cpp: In function ‘int main()’:
lengthsort.cpp:34:8: error: no match for ‘operator<<’ (operand types are ‘std::ostream’ {aka ‘std::basic_ostream<char>’} and ‘std::pair<std::__cxx11::basic_string<char>, int>’)
34 | cout << words[i] << endl;
| ~~~~ ^~ ~~~~~~~~
| | |
| | std::pair<std::__cxx11::basic_string<char>, int>
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/9/iostream:39,
from lengthsort.cpp:1:
/usr/include/c++/9/ostream:108:7: note: candidate: ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ostream_type& (*)(std::basic_ostream<_CharT, _Traits>::__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _T