字符串真是博大精深!!!
一道“字符串水题”卡了我这么久??
关键是gets函数的应用。
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int vis[10000];
int main()
{
char q[10000];
while(gets(q))
{
string s=q;
char c;
scanf("%c",&c);
int pos=s.find(c);
while(pos!=-1)
{
s.erase(pos,1);
pos=s.find(c,pos);
}
cout<<s<<endl;
getchar();///重点!一定要加上!!!
}
}