1064: Caeser Comes Back
| Result | TIME Limit | MEMORY Limit | Run Times | AC Times | JUDGE |
|---|---|---|---|---|---|
| 3s | 8192K | 1540 | 821 | Standard |
Assume you are a spy who is fulfilling a very important task. You have just stole a very important file from enemy's computer. Now you have to send the file to your headquarter by a special equipment. But in order to make safety, you should encode the file before sending it. Because the soldiers of enemy may come at any time, the encode process shouldn't take too much time. Under such situation, the only encode algorithm you could do is Caeser Encode Algorithm.
The Caeser algorithm can be expressed as:
In the encode process, a character is replaced by the 3rd one after it. Here you can assume that the file consists of only 'a' to 'z' and 'A' to 'Z'. So the last 3 characters are replaced by the first 3 characters. For example, consider this string abcdABCDwxyzWXYZ. After the encode process, it becomes defgDEFGzabcZABC. While in the decode process, this algorithm applies reversely.
Input Specification
The input consists of several lines. Each line consists of two strings A and B(at most 80 characters), separated by a space. If A equals to ENCODE, you should encode B while if A equals to DECODE, you should decode B. If A equals to END, that means the end of input, which you shouldn't process. No other values will A equal to except ENCODE, DECODE and END.
Output Specification
For each A=ENCODE or DECODE, you should encode or decode B and output the result on a single line each.
Sample Input
ENCODE abcd ENCODE WXYZ DECODE zAbC ENCODE aA END
Sample Output
defg ZABC wXyZ dD
Problem Source: 1st JOJ Cup Online VContest Warmup Problem
This problem is used for contest: 75
Submit / Problem List / Status / Discuss
2326

被折叠的 条评论
为什么被折叠?



