-->
当前位置:首页 > 题库

PROGRAMMING:Ace agent 3

Luz5年前 (2021-05-10)题库516
As we all know, Wangzai is a rich second generation from the United Arab Emirates, but in fact, all this is false! His real identity is the ace agent of the Mars intelligence agency. All this originated from a top secret plan... (10000 words are omitted here). One night, agent Wang Zai was going to send a file to the Mars intelligence agency, but he was afraid of the leakage of the file. So he decided to encrypt the file. The encryption rules are as follows:
First of all, there will be an "encrypted message" at the beginning of the letter, followed by the text (of course, encrypted Firestar). To decrypt the Martian character through certain rules, each Martian character will become a corresponding Firestar character. If "encrypted information" is "ACM", the encryption rules are as follows:
A C M B D E F G H I J K L N O P Q R S T U V W X Y Z
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
You may find that "ACM" is at the top of "encrypted information", followed by 26 Martian characters. So each character forms a one-to-one correspondence. The above corresponding to "a '- >" a', "C '- >" B', "m '- >" C', "B '- >" d ", and so on. The lowercase characters are the same as "a - >" a, "" C - > "B," "m - >" C, "" B - > "D.".
###Input format:
Multiple sets of input. In the first line, enter a string to indicate "encrypted information" (all uppercase English characters, and any two characters are different, such as "AAB"). In the second line, enter an integer n (1 < = n < = 10) to represent the number of lines in the text. Next N lines, each line input a string, representing a line of body (string length less than 200).
###Output format:
In addition to the encrypted information, output n lines, each line is the decrypted body.
###Input example:
```in
ACM
two
ee ff gg jj kk aa bb cc mm dd
H al wanf zah
WCM
one
FW Fw
```
###Output example:
The corresponding output is given here. For example:
```out
ff gg hh kk ll aa dd bb cc ee
I am wang zai
HA Ha
```







answer:If there is no answer, please comment