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

水水就好

Posted by xiexinxinlove at 2014-09-21 14:11:51 on Problem 3749
/*
POJ 3749
*/
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
char str[100];
char cm[300];
int main()
{
	while(scanf("%s",str) != EOF && strcmp(str,"ENDOFINPUT"))
	{
		getchar();
		gets(cm);
		scanf("%s",str);
		int len = strlen(cm);
		for(int i=0; i<len; i++)
		{
			if(cm[i] >= 'A' && cm[i] <= 'Z')
			{
				int m = cm[i] - 'A' - 5;
				if(m < 0)
				{
					m += 26;
				}
				cm[i] = 'A' + m;
			}
			cout<<cm[i];
		}
		cout<<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