| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
帮忙看看吧,why超时?#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator