求助!
查看原帖
求助!
636849
HiCode2009楼主2022/9/25 22:00

样例能过

#include<bits/stdc++.h>
using namespace std;
int a,b;
void solve()
{
	bool f=true;
	while(1)
	{
		if(a>b) swap(a,b);
		if(b%a==0) break;
		if(b>2*a) break;
		b-=a,f=!f;
	}
	if(f) cout<<"Stan wins"<<endl;
	else cout<<"Ollie wins"<<endl;
}
int main()
{
	while(1)
	{
		cin>>a>>b;
		if(!a&&!b) break;
		solve();
	}
	return 0;
}
2022/9/25 22:00
加载中...