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 why why/

Posted by 21127149 at 2006-08-29 13:37:38 on Problem 2328
#include"stdio.h"
#include"string.h"
main()
{
	int i,num,c[11];
	char a[3][12]={"too high","too low","right on"},b[12];
	scanf("%d",&num);getchar();
	while(num!=0)
	{
		scanf("%[^\n]",b);
		while(strcmp(a[2],b)!=0)
		{
			if(strcmp(a[0],b)==0)
			{
				for(i=num+1;i<11;i++)
				{
					c[i]=1;
				}
			}
			if(strcmp(a[1],b)==0)
			{
				for(i=num-1;i>0;i--)
					c[i]=1;
			}
			scanf("%d",&num);getchar();
			scanf("%[^\n]",b);				
		}
		if(c[num]==0)
			printf("Stan may be honest\n");
		else
			printf("Stan is dishonest\n");
		for(i=0;i<11;i++)
			c[i]=0;
		scanf("%d",&num);getchar();
	}
}

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