解题思路:
注意事项:
看了题解才知道原来是可以又空格的,题目就是个骗子。男人的嘴,骗人的鬼
参考代码:
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <vector> #include <string> #include <queue> #include <algorithm> #include <stdio.h> #define N 27 using namespace std; int main(int argc, char** argv) { string s; char ch; getline(cin, s); cin >> ch; string::iterator it = s.begin(); while (it < s.end()) { it = find(it, s.end(), ch); if (it != s.end()) it = s.erase(it); else break; } cout << s; return 0; }
0.0分
0 人评分
【蟠桃记】 (C语言代码)浏览:664 |
C语言程序设计教程(第三版)课后习题9.6 (C语言代码)浏览:373 |
C语言程序设计教程(第三版)课后习题5.6 (C语言代码)浏览:902 |
Cylinder (C语言描述+详细分析)浏览:3265 |
打印十字图 (C语言代码)浏览:2710 |
1035 题解浏览:785 |
整数平均值 (C语言代码)浏览:786 |
1052题解(链表操作)浏览:674 |
C语言程序设计教程(第三版)课后习题8.6 (C语言代码)浏览:585 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:459 |