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

诚心请教,为什么过不了?

Posted by 330332 at 2007-11-01 17:31:22 on Problem 2328
#include <stdio.h>
#include <cstring>
int main()
{
	int n;
	scanf("%d",&n);
	while( n!=0 )
	{
		char s[10];
		int max=10,min=1;
		scanf("%s",&s);
		scanf("%s",&s);
		if( strcmp(s,"on")==0 )
		{
			printf("Stan may be honest\n");
		}
		else
		{
			while( strcmp(s,"on")!=0 )
			{
				if( strcmp(s,"high")==0 )
				{
					max=n-1;
				}
				if( strcmp(s,"low")==0 )
				{
					min=n+1;
				}	
				scanf("%d",&n);
				if( n==0 )
				{
					break;
				}
				scanf("%s",&s);
				scanf("%s",&s);
			}
			if( max==min )
			{
				printf("Stan may be honest\n");
			}
			else
			{
				printf("Stan is dishonest\n");
			}
		}
		scanf("%d",&n);
	}
	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