Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
我的代码#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator