题中说第二行非空 而第一行不一定非空 也就是说没有 按键 broken
#include<iostream>
#include<cstdio>
#include<map>
#include<cstring>
#include<ctype.h>
using namespace std;
const int Size=100000;
int main()
{
char S1[Size], S2[Size];
map<char, bool>M;
gets(S1);// scanf 不能读空行
gets(S2);
int len1=strlen(S1);
int len2=strlen(S2);
if(len1==0)
{
puts(S2);
return 0;
}
for(int i=0; i<len1; i++)
if(!M.count(S1[i]))
M[S1[i]]=true;
for(int i=0; i<len2; i++)
if(!M.count(S2[i]))
{
if(isupper(S2[i]) && M.count('+'))
continue;
if(islower(S2[i]) && M.count(toupper(S2[i])))
continue;
printf("%c", S2[i]);
}
printf("\n");
return 0;
}