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

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

Posted by Sailing7 at 2009-02-09 19:32:17 on Problem 2348 and last updated at 2009-02-09 19:32:41
In Reply To:为什么会WA??大虾帮忙~~~~ Posted by:ACrun at 2007-01-16 12:16:29
算法错误

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