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:高手来看看 到底哪不对啊 测试数据都对 总是WA

Posted by rayafjyblue at 2010-10-18 14:17:09 on Problem 1575
In Reply To:高手来看看 到底哪不对啊 测试数据都对 总是WA Posted by:huanyinghj at 2010-09-02 11:08:52
> #include <stdio.h>
> #include <string.h>
> int main()
> {
> 	char str[21];
> 	int len,j,t,k,c1,c2,c3;
> 	char a='a',e='e',i='i',o='o',u='u',end[]={"end"};
> 	while(1)
> 	{
> 		t=k=c1=0;
> 		c2=c3=1;
> 		scanf("%s",str);
> 		if(strcmp(str,end)==0) break;
> 		len=strlen(str);
> 		if(len>20) continue;
> 		for(j=0;j<len;j++)
> 		{
> 			if(str[j]==a || str[j]==e || str[j]==i || str[j]==o || str[j]==u) 
> 			{
> 				c1=1;
> 				t++;
> 				k=0;
> 				if(t==3) {c1=0;break;}
> 			}
> 			else  
> 			{
> 				t=0;
> 				k++;
> 				if(k==3) {c2=0;break;}
> 			}
> 		}
> 		for(j=1;j<len;j++)
> 		{	if(str[j]==str[j-1] && str[j]!=e && str[j]!=o)
> 			{
> 				c3=0;
> 				break;
> 			}
> 		}
> 		if(c1==0 || c2==0 || c3==0)
> 			printf("<%s> is not acceptable.\n",str);
> 		else
> 			printf("<%s> is acceptable\n",str);
> 	}
> 	return 0;
> }
第二个acceptable少一个点,加了就ac了~~

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