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

为什么会WA??大虾帮忙~~~~

Posted by ACrun at 2007-01-16 12:16:29 on Problem 2348
#include<iostream>
using namespace std;
int main()
{
	int a,b;
	while(cin>>a>>b)
	{
		if(a==0&&b==0)return 0;
		if(a==b)cout<<"Stan wins\n";
		else{
		if(a<b)swap(a,b);
		int num=0;
		while(a<(2*b))
		{
			b=a-b;a=a-b;num++;
		}
		if(num%2==0)cout<<"Stan wins\n";
		else cout<<"Ollie wins\n";}
	}
	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