标签:
Description
Input
Output
Sample Input
START NS BFW, JAJSYX TK NRUTWYFSHJ FWJ YMJ WJXZQY TK YWNANFQ HFZXJX END START N BTZQI WFYMJW GJ KNWXY NS F QNYYQJ NGJWNFS ANQQFLJ YMFS XJHTSI NS WTRJ END START IFSLJW PSTBX KZQQ BJQQ YMFY HFJXFW NX RTWJ IFSLJWTZX YMFS MJ END ENDOFINPUT
Sample Output
IN WAR, EVENTS OF IMPORTANCE ARE THE RESULT OF TRIVIAL CAUSES I WOULD RATHER BE FIRST IN A LITTLE IBERIAN VILLAGE THAN SECOND IN ROME DANGER KNOWS FULL WELL THAT CAESAR IS MORE DANGEROUS THAN HE
解码,左移五位
#include <iostream> #include <string.h> #include <string> using namespace std; int main() { string a,b; while(cin>>a){ if(a=="ENDOFINPUT")break; if(a=="START"){ string c; char s[205]; int p=0; while(cin>>c){ if(c=="END")break; int n; n=c.length(); for(int i=0;i<n;i++){ if(c[i]>=‘A‘&&c[i]<=‘Z‘){ if(c[i]-5<‘A‘)c[i]=c[i]-4+‘Z‘-‘A‘; else c[i]-=5; } s[p]=c[i]; p++; } s[p]=‘ ‘; p++; } for(int i=0;i<p-1;i++)cout<<s[i]; cout<<endl; } } //system("pause"); return 0; }
输入输出格式!
标签:
原文地址:http://www.cnblogs.com/farewell-farewell/p/5184184.html