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 pjx_raul at 2008-03-19 14:43:54 on Problem 2328
#include <iostream>
#include <string>

using namespace std;

void main()
{
	
	int n;char b1[10]="too high",b2[10]="too low",b3[10]="right on";
	char a[10];
	memset(a,0,sizeof(a));
	int up=11,down=0;
	while(cin>>n,n!=0)
	{
		cin.get();
		
		
		gets(a);
		
		if(strcmp(a,b1)==0)up=n;
		
		else if(strcmp(a,b2)==0) down=n;
		else if(strcmp(a,b3)==0)
		{
			
			
			
			
			if((n>down)&&(n<up))
				cout<<"Stan may be honest"<<endl;
			else cout<<"Stan is dishonest"<<endl;
			
			up=11;down=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