| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
水水更健康~ 16ln#include <iostream>
#include <string>
#include <ctype.h>
using namespace std;
int main()
{ string msg;
while ( getline(cin, msg) ) {
if ( msg == "END" || msg == "START" ) continue;
else if ( msg == "ENDOFINPUT" ) break;
for (int i=0; i<msg.length(); i++)
if ( isalpha(msg[i]) )
msg[i] = 'A'+ (msg[i] -'A'-5+26)%26; //或者: = msg[i]-5 < 'A' ? msg[i]-5+26 : msg[i]-5;
cout << msg << endl;
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator