1.题目介绍
wear out:损坏
capitalized:大写的
2.考察点,难度
散列类,字符查找函数,字符大小写变化函数,字符判断函数,难度易
3.解题代码
#include <iostream>
#include <string>
#include <cstring>
using namespace std;
int main(){
int pos=0;
string Real,fase,result="";
getline(cin,Real);
getline(cin,fase);
for(int i=0;i<Real.length();i++){
if(fase.find(Real[i])==string::npos){
if(islower(Real[i])!=0 && result.find(toupper(Real[i]))==string::npos){
islower(Real[i])!=0?result+=toupper(Real[i]):result+=Real[i];
}
else if(islower(Real[i])==0 && result.find(Real[i])==string::npos){
result+=Real[i];
}
}
}
cout<<result<<endl;
return 0;
}
4.原题地址
https://pintia.cn/problem-sets/994805342720868352/problems/994805382902300672