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:我这个哪里错了

Posted by z__jj at 2009-01-18 20:38:24 on Problem 2348
In Reply To:我这个哪里错了 Posted by:71107418_ls at 2008-08-13 15:12:49
> #include <iostream>
> #include <fstream>
> using namespace std;
> 
> bool decide(int a,int b)
> {
> 	if(b==0)
> 		return 0;
> 	if(a>=2*b)
> 		return 1;
> 	return !decide(b,a-b);//这里改为else return !decide(b,a-b);
> }
> int main()
> {
> 	int a,b;
> 	ifstream cin ("test.txt");
> 	while(cin>>a>>b)
> 	{
> 		if(a==0&&b==0)
> 			break;
> 		if(a<b)
> 			swap(a,b);
> 		if(decide(a,b))
> 			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