#include <bits/stdc++.h>
using namespace std;
int a,b;
void dfs( int num1, int num2, int step )
{
if( num1 % num2 == 0 || num1 / num2 >= 2)
{
if( step%2 != 1 )
cout << "lose" << endl;
else
cout << "win" << endl;
return;
}
dfs( num2, num1%num2, step+1 );
}
int main()
{
while( cin >> a >> b , a!=0 || b!=0 )
{
if( a < b )
swap(a,b);
if( a / b >= 2 )
{
cout << "win" << endl;
continue;
}
dfs( a , b, 1 );
}
return 0;
}
dfs 取石子游戏
最新推荐文章于 2024-06-03 11:37:22 发布