来源:【LGR-187-Div.4】洛谷入门赛 #23
【LGR-187-Div.4】洛谷入门赛 #23 - 比赛详情 - 洛谷
全A代码!
#include <iostream>
#include <string>
#include <cctype>
using namespace std;
string removeNonAlphabetChars(string str) {
string result = "";
for (char c : str) {
if (isalpha(c)) {
result += c;
}
}
return result;
}
int main() {
string str;
cin >> str;
string result = removeNonAlphabetChars(str);
cout << result << endl;
return 0;
}