【Basic Level】
*1029
#include <iostream>
#include <string>
#include <cctype>
using namespace std;
int main()
{
string s, s1;
cin >> s >> s1;
int l = s.size();
int *a = new int[l]{};
int b[127] = {0};
for (int j = 0; j < l; ++j)
{
char c = s[j];
int n = s1.find(c);
if (n != string::npos)
{
a[j] = 1;
}
}
for (int i = 0; i < l; ++i)
{
if (a[i] == 0)
{
if (islower(s[i]))
{
if (b[(int)s[i] - 32] == 0)
{
cout << char(s[i] - 32);
b[(int)s[i] - 32] = 1;
}
}
else if (b[(int)s[i]] == 0)
{
cout << s[i];
b[(int)s[i]] = 1;
}
}
}
cout << "\n";
//system("pause");
return 0;
}