#include<iostream> #include<cstdio> #include<cstring> using namespace std; bool js(int a,int b) { if(a<b) swap(a,b); if(a%b==0) return true; for(int k=a/b;k>=1;k--) if(!js((a-b*k),b)) return true; return false; } int main() { int a,b; while((cin>>a>>b)&&!(a==0&&b==0)){ if(js(a,b)) cout<<"win"<<endl; else cout<<"lose"<<endl; } return 0; }
标签:return,游戏,int,1218,石子,js,&&,include From: https://www.cnblogs.com/zheng1945/p/17395794.html