Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

水水更健康~ 16ln

Posted by xusiwei1236 at 2012-06-24 12:10:46 on Problem 3749
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator