题解 | #字符串去特定字符#
字符串去特定字符
http://www.nowcoder.com/practice/d5d0450134db4cb994a1b323a35262da
#include <cstdio>
#include <string>
using namespace std;
int main() {
string s;
char c;
while (cin >> s >> c) {
for(int i = 0; i < s.size(); i++) {
while (s[i] == c) {
s.erase(i, 1);
}
}
cout << s;
}
return 0;
}