解题思路:
注意事项:
可能有空格
参考代码:
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <string> #include <stdio.h> using namespace std; int main() { string origStr; while (getline(cin,origStr)) { string ansStr; for (string::iterator it = origStr.begin(); it < origStr.end(); it++) if ((*it >= 'a' && *it <= 'z') || (*it >= 'A' && *it <= 'Z')) ansStr += *it; cout << ansStr << endl; } return 0; }
0.0分
0 人评分