Note
- 散列
Code:
#include<bits/stdc++.h>
using namespace std;
int main(){
#ifndef ONLINE_JUDGE
freopen("data.txt","r",stdin);
#endif
string s1,s2;
int yes[200]={0};
getline(cin,s1);
getline(cin,s2);
for(int i=0;i<s2.length();i++)
yes[s2[i]]=-1;
for(int j=0;j<s1.length();j++)
if(yes[s1[j]]!=-1)
yes[s1[j]]=1;
for(int j=0;j<s1.length();j++)
if(yes[s1[j]]==1){
yes[toupper(s1[j])]=0;
yes[tolower(s1[j])]=0;
printf("%c",toupper(s1[j]));
}
return 0;
}