第二道题看错题了,提交之 才弄明白。。提交一下改过的代码,各位看着有问题不?? #include<string> #include<iostream> using namespace std; int main(){ string str; cin >> str; char c; cin >> c; str += c; string res; for (int i = 0; i < str.size(); i++){ if (str[i] != c) res += str[i]; if (str[i] == c ) { cout << res << endl; res.clear(); } } }