#include <iostream>
#include <string>
using namespace std;
int main()
{
string s1, s2;
getline(cin, s1);
getline(cin, s2);
int index = s1.find(s2);
while(index >= 0)
{
s1.erase(index, s2.length());
index = s1.find(s2);
}
cout<<s1<<endl;
}
PTA 7-1 删除字符串中的子串 (20分)
最新推荐文章于 2022-10-17 09:13:04 发布