20/20,第一次没调试就过了。
#include<bits/stdc++.h>
using namespace std;
/*
1.standardize
2.put to the sets
3.minus
*/
set<char> charset;
vector<char> broken;
int main(){
string strA,strB;
cin>>strA>>strB;
transform(strA.begin(),strA.end(),strA.begin(),::toupper);
transform(strB.begin(),strB.end(),strB.begin(),::toupper);
for(int i=0;i<strB.length();i++){
if(!charset.count(strB[i])) charset.insert(strB[i]);
}
for(int i=0;i<strA.length();i++){
if(!charset.count(strA[i])) {
broken.push_back(strA[i]);
charset.insert(strA[i]);
}
}
for(int i=0;i<broken.size();i++){
printf("%c",broken[i]);
}
return 0;
}