/*
题目1049:字符串去特定字符
题目描述:
输入字符串s和字符c,要求去掉s中所有的c字符,并输出结果。
输入:
测试数据有多组,每组输入字符串s和字符c。
输出:
对于每组输入,输出去除c字符后的结果。
样例输入:
heallo
a
样例输出:
hello
*/
# include<iostream>
# include<cstring>
# include<vector>
# include<algorithm>
# include<iterator>
using namespace std;
int main()
{
char a[200];
char c;
while(cin>>a)
{
int l=strlen(a);
vector<char> v1(a,a+l);
char c;
cin>>c;
vector<char>::iterator last=remove(v1.begin(),v1.end(),c);
copy(v1.begin(),last,ostream_iterator<char>(cout,""));
cout<<endl;
}
return 0;
}
题目1049:字符串去特定字符
题目描述:
输入字符串s和字符c,要求去掉s中所有的c字符,并输出结果。
输入:
测试数据有多组,每组输入字符串s和字符c。
输出:
对于每组输入,输出去除c字符后的结果。
样例输入:
heallo
a
样例输出:
hello
*/
# include<iostream>
# include<cstring>
# include<vector>
# include<algorithm>
# include<iterator>
using namespace std;
int main()
{
char a[200];
char c;
while(cin>>a)
{
int l=strlen(a);
vector<char> v1(a,a+l);
char c;
cin>>c;
vector<char>::iterator last=remove(v1.begin(),v1.end(),c);
copy(v1.begin(),last,ostream_iterator<char>(cout,""));
cout<<endl;
}
return 0;
}