10: simple password, 10 Password
10: Simple Password
- View
- Submit
- Statistics
- Question
-
Total time limit:
-
1000 ms
-
Memory limit:
-
65536kB
-
Description
-
Julius Caesar used a very simple password. For each character in plain text, replace it with the last five characters in its alphabet, and then obtain the ciphertext. For example, character A is replaced by character F. The following is the correspondence between ciphertext and characters in plain text.
Ciphertext
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
Plaintext
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
Your task is to decrypt the specified ciphertext to obtain the plaintext.
Note that all the letters in the password are uppercase letters. Ciphertext contains non-letter characters, which are not decoded.
-
Input
-
A row that provides the ciphertext. The ciphertext is not empty, and the number of characters cannot exceed 200.
-
Output
-
Output a line, that is, the plaintext corresponding to the ciphertext.
-
Sample Input
-
NS BFW, JAJSYX TK NRUTWYFSHJ FWJ YMJ WJXZQY TK YWNANFQ HFZXJX
-
Sample output
-
IN WAR, EVENTS OF IMPORTANCE ARE THE RESULT OF TRIVIAL CAUSES
-
Source
-
Translated from South Central USA 2002
-
1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 using namespace std; 5 char a[100001]; 6 char ans[100001]; 7 int now=0; 8 int main() 9 {10 gets(a);11 int l=strlen(a);12 for(int i=0;i<l;i++)13 {14 if(a[i]>=70&&a[i]<=90)a[i]=a[i]-5;15 else if(a[i]>=65&&a[i]<70)a[i]=a[i]+21;16 }17 puts(a);18 return 0;19 }