
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
Description
You are a sub captain of Caesar's army. It is your job to decipher the messages sent by Caesar and provide to your general. The code is simple. For each letter in a plaintext message, you shift it five places to the right to create the secure message (i.e., if the letter is 'A', the cipher text would be 'F'). Since you are creating plain text out of Caesar's messages, you will do the opposite:
Cipher text
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
Plain text
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
Only letters are shifted in this cipher. Any non-alphabetical character should remain the same, and all alphabetical characters will be upper case.
Input
A single data set has 3 components:
Start line - A single line, "START"
Cipher message - A single line containing from one to two hundred characters, inclusive, comprising a single message from Caesar
End line - A single line, "END"
Following the final data set will be a single line, "ENDOFINPUT".
Output
Sample Input
Sample Output
#include<bits/stdc++.h>
using namespace std;
int main() {
char s[],s1[],s2[];
while(gets(s1)&&strcmp(s1,"START")==) {
gets(s);
int len=strlen(s);
for(int i=; i<len; i++) {
if(isupper(s[i]))
s[i]=(s[i]-'A'+)%+'A';
}
while(gets(s2)&&strcmp(s2,"END")==) {
puts(s);
break;
}
}
return ;
}