编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#22373 | #1120. Rhodoks的排序 | Compile Error | 0 | 0 ms | 0 K | C++ / 336 B | 电类904-穆琳杰 | 2020-02-12 19:43:57 |
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 1e5 + 5;
bool cmp(char a, char b) {
if (a <= 90 && a >= 65 && b >= 97 && b <= 122)
return a > b;
else
return a < b;
}
char a[N];
int main() {
gets(a);
int len = strlen(a);
sort(a, a + len, cmp);
for (int i = 0; i < len; i++) cout << a[i];
return 0;
}
编译信息
/sandbox/1/a.cpp: In function 'int main()':
/sandbox/1/a.cpp:15:2: error: 'gets' was not declared in this scope
gets(a);
^~~~
/sandbox/1/a.cpp:15:2: note: suggested alternative: 'getpt'
gets(a);
^~~~
getpt