10: simple password, 10 Password

Source: Internet
Author: User

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 }

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.