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 highspeed at 2010-07-30 12:13:46 on Problem 2348
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
using namespace std;

int mmax,mmin;
int main()
{
	while(cin>>mmax>>mmin&&!(mmax==0&&mmin==0))
	{
		if(mmax<mmin)swap(mmax,mmin);
		int flag=0;
		while(1)
		{
			if(mmax/mmin>=2||mmax==mmin)break;
			int temp=mmax-mmin;
			mmax=mmin;mmin=temp;
			flag++;
		}
		if(flag%2==0)cout<<"Stan wins"<<endl;
		else cout<<"Ollie wins"<<endl;
	}
	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