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 huanghaoxiang at 2009-10-19 22:21:25 on Problem 2328
#include <stdio.h>
#include <string.h>

int main()
{
	int max = 11,min = 0;
	char s1[100];
	int num;
	while ( scanf ( "%d\n",&num )  )
	{
		if ( num == 0 )
			break;
		gets( s1 );
		if ( strcmp( s1,"too high" ) == 0 && num <= max )
			max = num;
		else if ( strcmp( s1,"too low" ) == 0 && num >= min )
			min = num;
		else if ( strcmp(s1,"right on") == 0 )
		{
			if ( num > min && num < max  )
				printf( "Stan may be honest\n" );
			else printf ( "Stan is dishonest\n" );
			max = 11;
			min = 0;
		}
	}
	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