Problem lengthsort
User CKCodeBreaker55
Submission Time 2024-12-08 17:03:57
Score 0
Max Time N/A
Max Memory N/A

Compile Error

lengthsort.cpp: In function ‘int main()’:
lengthsort.cpp:9:2: error: a function-definition is not allowed here before ‘{’ token
9 | {
| ^
lengthsort.cpp:27:19: error: ‘comp’ was not declared in this scope
27 | sort(arr, arr+n, comp);
| ^~~~
lengthsort.cpp:31:8: error: no match for ‘operator<<’ (operand types are ‘std::ostream’ {aka ‘std::basic_ostream<char>’} and ‘std::pair<std::__cxx11::basic_string<char>, long long int>’)
31 | cout << arr[i] << "\n";
| ~~~~ ^~ ~~~~~~
| | |
| | std::pair<std::__cxx11::basic_string<char>, long long int>
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/9/istream:39,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:3