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 f_jy at 2005-03-24 20:37:42 on Problem 2328
#include<string.h>
#include<stdio.h>
#include<iostream.h>
void main(){
int num;
char judge[9];
cin>>num;
gets(judge);
int max=10,min=1;
while(1)
	{
	if(strcmp(judge,"too high")==0)
		{
		if(max>num)max=num;
		}
	
		else if(strcmp(judge,"too low")==0)
			{
			if(min<num)min=num;
			}
			else if(strcmp(judge,"right on")==0)
				{
				if(num>=min&&num<=max)cout<<"Stan may be honest"<<endl;
				else cout<<"Stan is dishonest"<<endl;
				min=1;
				max=10;
				}
	cin>>num;
	if(num==0)break;
	gets(judge);
	
	}

}

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