偷个懒,用个string的库函数
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
string a, b;
getline(cin, a);
getline(cin, b);
string res;
for (auto c : a)
{
if (b.find(c) == -1)
res += c;
}
cout << res << endl;
return 0;
}