Problem sort
User wayne
Submission Time 2024-02-02 15:22:10
Score 0
Max Time N/A
Max Memory N/A

Compile Error

sort.cpp: In function ‘int main()’:
sort.cpp:7:16: error: could not convert ‘n’ from ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to ‘long unsigned int’
7 | string arr[n];
| ^
sort.cpp:7:16: error: size of array ‘arr’ has non-integral type ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’}
sort.cpp:9:24: error: no match for ‘operator<’ (operand types are ‘long long int’ and ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’})
9 | for(long long i=0;i<n;i++){
| ~^~
| | |
| | std::string {aka std::__cxx11::basic_string<char>}
| long long int
In file included from /usr/include/c++/9/regex:62,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:110,
from sort.cpp:2:
/usr/include/c++/9/bits/regex.h:1048:5: note: candidate