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

Re:AC后的代码,给大家参考一下!

Posted by lianghaijian at 2009-06-02 14:50:35 on Problem 1298
In Reply To:AC后的代码,给大家参考一下! Posted by:microQ at 2008-11-24 14:10:38
> #include <stdio.h>
> #include <ctype.h>
> #include <string.h>
> #define SIZE 512
> 
> int main(void)
> {
> 	int i = 0;
> 	char s[SIZE];
> 	while(gets(s) && strcmp(s, "ENDOFINPUT"))
> 	{
> 		if(! strcmp(s, "START") || ! strcmp(s, "END"))
> 			continue;
> 		for(i = 0; s[i] != 0 && i < SIZE; ++i)
> 		{
> 			if (! isupper(s[i]))
> 				continue;
> 			s[i] -= 5;
> 			if (s[i] < 'A')
> 				s[i] += 26;
> 		}
> 		printf("%s\n", s);
> 	}
> 	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