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?!!!!!!!!!!!!!!???????///WHY?

Posted by 1987 at 2005-04-27 22:27:50 on Problem 2328
#include<iostream.h>
void main()
{
	short a=1,b=10,c=1;
	char f;
	bool p=0;
	cin>>c;
	while(c!=0)
	{
		if(a>c||b<c)
		p=1;
		cin.ignore(5);
		f=cin.get();
		if(f=='h')
			b=c-1;
		if(f=='l')
			a=c+1;
		if(a>b)
		p=1;
		
		if(f=='t')
		{
			if(p)
			cout<<"Stan is dishonest"<<endl;
			else
			cout<<"Stan may be honest"<<endl;
			p=0,a=1,b=10;
		}
		while(1)
		{
			f=cin.get();
			if(f=='\n')
				break;
		}
		cin>>c;
	}
}

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