题目链接: https://pintia.cn/problem-sets/994805342720868352/problems/type/7
思路: 暴力美学+水题,注意字符串的处理
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <map>
using namespace std;
#define inf 0x3f3f3f3f
const int maxn = 10000 + 10;
int main(int argc, const char **argv)
{
string s1, s2;
getline(cin, s1);
getline(cin, s2);
int len = s1.length();
int len2 = s2.length();
int flag[maxn];
for (int i = 0; i < s1.length(); i++)
{
flag[i] = 0;
}
for (int i = 0; i < len; i++)
{
for (int j = 0; j < len2; j++)
{
if (s1[i] == s2[j])
flag[i] = 1;
}
}
for (int i = 0; i < len; i++)
{
if (flag[i] == 0)
{
cout << s1[i];
}
else
{
continue;
}
}
cout << endl;
return 0;
}