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 AP0606409 at 2008-09-02 16:58:09 on Problem 2328
#include <iostream>
using namespace std;
int main()
{
	int var;
	char dicats[9];
	int high_var=10,low_var=0;
	while ( cin >> var)
	{
		while (cin>>dicats)
		{
			if("too high"== dicats) 
			{
				high_var=var;
				continue;
			}
			else{
				if("too low"==dicats)
				{
					low_var=var;
					continue;
				}
				else{
					if( "right on"==dicats)
					{
						if(high_var<=low_var) cout<<"Stan is dishonest\n";
						else cout<<"Stan may be honest\n";
						break;

					}
				}	
			}
		}
	}
	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