旧键盘上坏了几个键,因而在敲一段文字的时候,对应的字符就不会出现。如今给出应该输入的一段文字、以及坏掉的那些键,打出的结果文字会是怎样?spa
输入格式:code
输入在2行中分别给出坏掉的那些键、以及应该输入的文字。其中对应英文字母的坏键以大写给出;每段文字是不超过105个字符的串。可用的字符包括字母[a-z, A-Z]、数字0-九、以及下划线“_”(表明空格)、“,”、“.”、“-”、“+”(表明上档键)。题目保证第2行输入的文字串非空。blog
注意:若是上档键坏掉了,那么大写的英文字母没法被打出。内存
输出格式:get
在一行中输出可以被打出的结果文字。若是没有一个字符能被打出,则输出空行。string
输入样例:7+IE. 7_This_is_a_test.输出样例:
_hs_s_a_tst
1 #include<stdio.h> 2 #include<math.h> 3 #include<stdlib.h> 4 #include<string.h> 5 #include<algorithm> 6 using namespace std; 7 8 int main() 9 { 10 int hashtable[150] = {}; 11 int i, j; 12 char s1[100010], s2[100010], c; 13 gets(s1); 14 gets(s2); 15 int len1, len2; 16 len1 = strlen(s1); 17 len2 = strlen(s2); 18 for(i = 0; i < len1; i++) 19 { 20 c = s1[i]; 21 hashtable[c] = 1; 22 } 23 for(i = 0; i < len2; i++) 24 { 25 c = s2[i]; 26 if(hashtable['+'] == 1 && c >= 'A' && c <= 'Z') 27 continue; 28 if(hashtable[c] == 1) 29 continue; 30 if(c >= 'a' && c <= 'z' && hashtable[c + 'A' - 'a'] == 1) 31 continue; 32 printf("%c", c); 33 } 34 printf("\n"); 35 return 0; 36 }