题目链接
https://www.nowcoder.com/pat/6/problem/4059
代码
#include<iostream>
#include<string>
using namespace std;
int main() {
string s1, s2;
int flag;
cin >> s1 >> s2;
flag = s1.find('+') == -1 ? 0 : 1;
for(int i=0; i<s2.size(); i++) {
char c;
if(s2[i] >= 'A' && s2[i] <= 'Z' && flag) continue;
else if(s2[i] >= 'a' && s2[i] <= 'z') c = s2[i] - 32;
else c = s2[i];
if(s1.find(c) == -1) cout << s2[i];
}
return 0;
}