要求是按照检测的顺序输出,因此输出顺序应当和第一条字符串中字符出现的顺序一致
#include <bits/stdc++.h>
using namespace std;
int main(){
string s1,s2;
cin>>s1>>s2;
string res;
map<char,bool> mp;
for(auto c:s2)mp[toupper(c)]=true;
for(auto c:s1){
if(!mp[toupper(c)]){
res+=toupper(c);
mp[toupper(c)]=true;
}
}
printf("%s",res.c_str());
}