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 cailizhong at 2010-07-30 23:18:17 on Problem 1298
#include <stdio.h>
#include <string.h>
char cipher[500];
char plainText[27]={"VWXYZABCDEFGHIJKLMNOPQRSTU"};
int main()
{
	int i, l;
	while (gets(cipher))
	{
		if (strcmp("START",cipher) == 0) ;
		else if (strcmp("END",cipher) == 0) printf("\n");
		else if (strcmp("ENDOFINPUT",cipher) == 0) return 0;
		else
		{
			l = strlen(cipher);
			for (i = 0; i < l; i++)
			{
				if (cipher[i]>='A' && cipher[i]<='Z') printf("%c",plainText[cipher[i]-'A']);
				else printf("%c",cipher[i]);
			}
		}
	}
	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