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

Re:改着改着对了..........

Posted by ipku at 2010-07-10 20:49:40 on Problem 2328
In Reply To:改着改着对了.......... Posted by:huanghaoxiang at 2009-10-19 22:21:25
是的
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
	int a,big,low;
	char b[20];
	scanf("%d",&a);
	big=11;low=0;
	while(a!=0){
		getchar();
	    gets(b);
		if(strcmp(b,"too high")==0)
		{if(a<big) big=a;}
		if(strcmp(b,"too low")==0)
		{if(a>low) low=a;}
		if(strcmp(b,"right on")==0)
		{if(big>low&&big-low>1&&a>low&&a<big) printf("Stan may be honest\n");
	     else printf("Stan is dishonest\n");
	     big=11;low=0;}
		scanf("%d",&a);
	}
	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