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

提交了N遍,就是不知道那里RA,麻烦大家看看!!

Posted by huanmo at 2007-04-19 11:47:13 on Problem 2328
#include<iostream>
using namespace std;
#include<cstdio>

int main()
{
	int n, i, high=11, low=0, right=0;
	char s[8];
	int k=1;
	while(cin>>n)
	{
		if(n==0)
			break;
		getchar();
		gets(s);
	  
		if(s[4]=='h')i=0;
		else if(s[4]=='l')i=1;
		else if(s[4]=='t')i=2;

		
		if(i==0&&high>n)high=n;
		else if(i==1&&low<n)low=n;
		else if(i==2)right=n;

		if(right!=0)
		{
			if(right<high&&right>low&&right>0&&right<11)
				cout<<"Stan may be honest"<<endl;
			else 
				cout<<"Stan is dishonest"<<endl;

			right=low=0;high=11;
			k=0;
		}
	}
	
    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