The law of a telegraph office's message secrecy is to turn every English letter into a 4th letter (very primitive kind), such as a to e,a into E. The last four letters (W,X,Y,Z or W,X,Y,Z) become the first 4 letters (A,B,C,D or A,B,C,D). Non-alphabetic characters do not change. Enter a line of letters that requires the output of the corresponding encrypted text .
The code is as follows:
#include <iostream> #include <cstdio>using namespace Std;int main () { char str[100]; int i=0; Gets (str); while (str[i]!= ') { if ((str[i]>= ' A ' &&str[i]<= ' V ') | | (str[i]>= ' a ' &&str[i]<= ' V ')) str[i]+=4; else if ((str[i]>= ' W ' &&str[i]<= ' Z ') | | (str[i]>= ' W ' &&str[i]<= ' z ')) str[i]-=22; ++i; } cout<<str; return 0;}
Operation Result:
Say ashamed, this problem is I in a C language book to see the C language code to C + + code to submit to the teacher, the results of their original code has been submitted on the OJ platform after the display output overrun, crying drunk,, resulting in my last problem also failed to complete in time ... Last night to take these two problems after the early morning to the school room to make up,,, the results in the room outside for half an hour,, in short, this is really a sad story.
18th Week OJ test Project 5--Confidential message