#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <stack>
#include <sstream>
using namespace std;
//1168
string mod;
string s,t;
int main(){
//freopen("input.txt","r",stdin);
getline(cin,mod);
for(int i=0;i<mod.size();i++) mod[i]=toupper(mod[i]);
while(getline(cin,s)){
t=s;
for(int i=0;i<t.size();i++) t[i]=toupper(t[i]);
int p=t.find(mod);
while(p!=string::npos){
t.erase(p,mod.size());
s.erase(p,mod.size());
p=t.find(mod);
}
p=s.find(' ');
while(p!=string::npos){
s.erase(p,1);
p=s.find(' ');
}
cout<<s<<endl;
}
return 0;
}
/**************************************************************
Problem: 1168
User: cust123
Language: C++
Result: Accepted
Time:0 ms
Memory:1520 kb
****************************************************************/
题目1168:字符串的查找删除
最新推荐文章于 2020-07-22 11:01:06 发布