编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#22513 #1120. Rhodoks的排序 Compile Error 0 0 ms 0 K C++ / 440 B 计试91-李禹陪 2020-02-13 2:00:41
显示原始代码
#include <iostream>
#include <map>
#include <algorithm>
using namespace std;
char a[10010], b[10010];
int main() {
    ios::sync_with_stdio(false);  //��cinͬ��������
    cin >> a;
    sort(a, a + strlen(a));
    char* p = a;
    for (int i = 0; *p != 0; p++) {
        if (*p >= '0' && *p <= '9')
            cout << *p;
        else if (*p >= 'A' && *p <= 'Z')
            b[i] = *p, i++;
        else if (*p >= 'a' && *p <= 'z')
            cout << *p;
    }
    cout << b;
    return 0;
}

编译信息

/sandbox/1/a.cpp: In function 'int main()':
/sandbox/1/a.cpp:9:12: error: 'strlen' was not declared in this scope
  sort(a, a+strlen(a));
            ^~~~~~
/sandbox/1/a.cpp:9:12: note: 'strlen' is defined in header '<cstring>'; did you forget to '#include <cstring>'?
/sandbox/1/a.cpp:4:1:
+#include <cstring>
 using namespace std;
/sandbox/1/a.cpp:9:12:
  sort(a, a+strlen(a));
            ^~~~~~