编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#22574 | #1120. Rhodoks的排序 | Compile Error | 0 | 0 ms | 0 K | C++ / 806 B | 电类937权冬瑞 | 2020-02-13 14:07:04 |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool cmp(char a, char b) { return a < b; }
int main() {
char buff[100000];
cin >> buff;
for (int i = 0; buff[i] != '\0'; i++) {
if (buff[i] < 58) {
vector<char> a;
a.pushback(buff[i]);
}
if (buff[i] > 58 && buff[i] < 91) {
vector<char> b;
b.pushback(buff[i]);
}
if (buff[i] > 91) {
vector<char> c;
c.pushback(buff[i]);
}
}
sort(a.begin(), a.end(), cmp);
for (int i = 0; i < a.size(); i++) cout << a[i];
sort(c.begin(), c.end(), cmp);
for (int i = 0; i < c.size(); i++) cout << c[i];
sort(b.begin(), b.end(), cmp);
for (int i = 0; i < b.size(); i++) cout << b[i];
return 0;
}
编译信息
/sandbox/1/a.cpp: In function 'int main()':
/sandbox/1/a.cpp:14:15: error: 'class std::vector<char>' has no member named 'pushback'; did you mean 'push_back'?
a.pushback(buff[i]);
^~~~~~~~
push_back
/sandbox/1/a.cpp:18:15: error: 'class std::vector<char>' has no member named 'pushback'; did you mean 'push_back'?
b.pushback(buff[i]);
^~~~~~~~
push_back
/sandbox/1/a.cpp:22:15: error: 'class std::vector<char>' has no member named 'pushback'; did you mean 'push_back'?
c.pushback(buff[i]);
^~~~~~~~
push_back
/sandbox/1/a.cpp:25:10: error: 'a' was not declared in this scope
sort(a.begin(),a.end(),cmp);
^
/sandbox/1/a.cpp:27:10: error: 'c' was not declared in this scope
sort(c.begin(),c.end(),cmp);
^
/sandbox/1/a.cpp:29:10: error: 'b' was not declared in this scope
sort(b.begin(),b.end(),cmp);
^