您的位置:首页 > 其它

POJ 2348

2015-06-11 10:48 190 查看
#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
//freopen("acm.acm","r",stdin);
int _max;
int _min;
bool boo_s;
while(cin>>_max>>_min,_max || _min)
{
boo_s = true;
while(true)
{
if(_max < _min)
{
iter_swap(&_max,&_min);
}
if(_max / _min > 1)
{
break;
}
_max -= _min;
iter_swap(&_max,&_min);
if(_min == 0)
break;
boo_s = !boo_s;
}

if(boo_s)
{
cout<<"Stan wins"<<endl;
}
else
{
cout<<"Ollie wins"<<endl;
}

}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: