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

帮忙看看吧,why超时?

Posted by sky4091 at 2006-08-20 19:28:01
#include<stdio.h>
#include<string.h>
int main()
{char S[6],E[11],s[]="START",e1[]="END",e2[]="ENDOFINPUT";
 char text[201];
 int i;
 	while(1)
 		{gets(S);
		 if (strcmp(S,s)==0)
			{gets(text);
             for (i=0;text[i]!='\0';i++)
		 			if (text[i]>=65 && text[i]<=90) 
						{text[i]-=5;
                         if (text[i]<65) text[i]+=26;
                        }
					else ;
			}
		 else continue;
 		 gets(E);
		 if (strcmp(E,e1)==0) puts(text);
		 else if (strcmp(E,e2)==0) 
					{puts(text);
					 break;
					}
		}
	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