编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#22405 | #1120. Rhodoks的排序 | Compile Error | 0 | 0 ms | 0 K | C++ / 158 B | 物联网81 陶恩泽 | 2020-02-12 20:40:02 |
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
char a[100000];
cin >> a;
sort(a);
cout << a;
return 0;
}
编译信息
/sandbox/1/a.cpp: In function 'int main()':
/sandbox/1/a.cpp:8:11: error: no matching function for call to 'sort(char [100000])'
sort(a);
^
In file included from /usr/include/c++/8/algorithm:62,
from /sandbox/1/a.cpp:2:
/usr/include/c++/8/bits/stl_algo.h:4824:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
^~~~
/usr/include/c++/8/bits/stl_algo.h:4824:5: note: template argument deduction/substitution failed:
/sandbox/1/a.cpp:8:11: note: candidate expects 2 arguments, 1 provided
sort(a);
^
In file included from /usr/include/c++/8/algorithm:62,
from /sandbox/1/a.cpp:2:
/usr/include/c++/8/bits/stl_algo.h:4854:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
^~~~
/usr/include/c++/8/bits/stl_algo.h:4854:5: note: template argument deduction/substitution failed:
/sandbox/1/a.cpp:8:11: note: candidate expects 3 arguments, 1 provided
sort(a);
^