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

注意是"dishonest'

Posted by shakamoto at 2006-04-21 21:23:32 on Problem 2328
In Reply To:难道有垃圾数据吗?哪位大虾帮我看看?怎么就WA了呢? Posted by:xiedf at 2006-03-28 20:55:40
> #include<iostream.h>
> #include<stdio.h>
> #include<string.h>
> int main()
> {
> 	int a,b=10,c=1;
> 	char s[10];
> 	while(1)
> 	{
> 		cin>>a;
> 		if(a==0)break;
> 		gets(s);
> 		if(strcmp(s,"too high")==0)
> 		{
> 			if(b>=a)b=a-1;
> 		}
> 		else if(strcmp(s,"too low")==0)
> 			{
> 				if(c<=a)c=a+1;
> 			}
> 			 else if(strcmp(s,"right on")==0)
> 				{
> 					 if(a>=c&&a<=b)cout<<"Stan may be honest"<<endl;
> 					 else cout<<"Stan is dishonest"<<endl;
> 					 b=10;
> 					 c=1;
> 				}
> 	}
> 	return 1;
> }

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