|
||||||||||
Encoded Love-letterTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2009 Accepted Submission(s): 761 Problem Description After Gardon had got Angel's letter, he found it was encoded...Oh my god, why did she encode a love-letter?? But don't worry, she wrote the algorithm for encoding after the letter: Each charactor are changed to a corresponding charactor. If the keyword is "Angel", the rule will be: ABCDEFGHIJKLMNOPQRSTUVWXYZ ANGELZYXWVUTSRQPOMKJIHFDCB You may find that in the bottom line, charactors of the keyword come first. All other charactors will come in a reversed order. Now given another keyword, work the letter out! Can you write a program to translate the letter? Input The letter will begin with the keyword (All uppercase), then lines of text. Output Decode the letter and print it out. Please note that a upper-case charactor will be decoded to a upper-case charactor, while a lower-case charactor will be decoded to a lower-case charactor. Sample Input
Sample Output
Author DYGG Source | ||||||||||
|