1033. Old keyboard Typing (20) time limit MS Memory limit 65536 KB code length limit 8000 B procedure StandardAuthor Chen, Yue
The old keyboard has broken a few keys, so when you hit a piece of text, the corresponding characters will not appear. Now give the text that should be entered, as well as the broken keys, the results of the text will be typed?
Input format:
Enter the keys that were broken in 2 rows, and the text that should be entered. The bad key corresponding to the English letter is given in uppercase, and each paragraph is a string of no more than 105 characters. The available characters are the letters [a-Z, A-z], the number 0-9, and the Underscore "_" (for spaces), ",", ".", "-", "+" (on behalf of the upper file key). The title guarantees that the text string entered in line 2nd is not empty.
Note: If the upper file key is broken, the uppercase English letter cannot be typed.
Output format:
Outputs the result text that can be typed in a row. If no word rp is typed, a blank line is output.
Input Sample:
7+ie.7_this_is_a_test.
Sample output:
_hs_s_a_tst
Idea: ' + ' and ' _ ' are the keys to judging
1#include <bits/stdc++.h>2 using namespacestd;3 intMain ()4 {5 Chara[100010],b[100010];6 intaa[100010]= {0};7 gets (a);8 gets (b);9 intshift=0, blank=0;Ten intLa=strlen (a); One intlb=strlen (b); A for(intI=0; i<la; i++) - { -aa[a[i]]=1; the if(Islower (A[i])) - { -a[i]-= +; -aa[a[i]]=1; + } - Else if(Isupper (A[i])) + { Aa[i]+= +; ataa[a[i]]=1; - - } - if(a[i]=='+') -shift=1; - if(a[i]=='_') inblank=1; - to } + for(intI=0; i<lb; i++) - { the if(Shift) * { $ if(!isupper (B[i]) &&aa[b[i]]==0)Panax Notoginsengcout<<B[i]; - } the Else if(blank) { + if(b[i]!=' '&&aa[b[i]]==0) Acout<<B[i]; the } + Else - { $ if(aa[b[i]]==0) $cout<<B[i]; - } - } the return 0; -}
Pat-B-1033. Old keyboard typing (20)