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

WA,很简单的,怎么就WA?

Posted by BJ051155 at 2007-04-16 13:43:36 on Problem 2328
#include <iostream.h>
#include <stdio.h>


int main(int argc, char* argv[])
{
	int b=0,s=11,g;
	char c[10];
	while(1)
	{
		b=10;
		s=1;
		cin>>g;
		if(!g)
			return 0;
		while(gets(c))
		{
			if(c[4]=='h')
				if(g-1<b)
					b=g-1;
			if(c[4]=='l')
				if(g+1>s)
					s=g+1;
			if(c[4]=='t')
			{
				if(g>=s&&g<=b)
					cout<<"Stan may be honest"<<endl;
				else
					cout<<"Stan is dishonest"<<endl;
				break;
			}
			cin>>g;
			
		}
	}
	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