删除字符串中所有指定的字符后输出
定义哈希表存放要删除的字符ASCII码
遍历原串,判断后输出
#include<iostream>
#include<string>
using namespace std;
int main()
{
string a,b;
getline(cin,a);
getline(cin,b);
bool hash[128]={false};
int i;
for(i=0;i<b.size();i++)hash[b[i]]=true;
for(i=0;i<a.size();i++)if(hash[a[i]]==false)cout<<a[i];
return 0;
}