09: Password translation, 09: Password Translation
09: Password Translation
- View
- Submit
- Statistics
- Question
-
Total time limit:
-
1000 ms
-
Memory limit:
-
65536kB
-
Description
-
In the process of intelligence transmission, in order to prevent intelligence interception, we often need to encrypt the intelligence in a certain way. Although simple encryption algorithms are not enough to completely prevent intelligence deciphering, however, it can still prevent intelligence from being easily identified. We provide a simplest encryption method for a given string, replace the letters from a-y, A-Y with its successor letters, replace z and Z with a and A. If other non-letter characters remain the same, a simple encrypted string is obtained.
-
Input
-
Enter a line containing a string of less than 80 characters.
-
Output
-
Output the encrypted string of each string.
-
Sample Input
-
Hello! How are you!
-
Sample output
-
Ifmmp! Ipx bsf zpv!
-
Source
-
Computing overview 05
-
1 #include<iostream> 2 #include<cstring> 3 #include<cstdio> 4 using namespace std; 5 char a[10001]; 6 int main() 7 { 8 gets(a); 9 int l=strlen(a);10 for(int i=0;i<l;i++)11 {12 if(a[i]=='z')a[i]='a';13 else if(a[i]=='Z')a[i]='A';14 else if((a[i]>='A'&&a[i]<='Z')||(a[i]>='a'&&a[i]<='z'))15 a[i]=a[i]+1;16 }17 puts(a);18 return 0;19 }