poj2348(博弈推理)Euclid's Game

xiaoxiao2021-02-28  90

//一系列推导 #include<iostream> #include<cstdio> using namespace std; void solve(int a,int b) { bool f=true; while(1) { if(a<b) swap(a,b); if(a-b>b||a%b==0) break; a-=b; f^=true; } if(f) puts("Stan wins"); else puts("Ollie wins"); } int main(){ int a,b; while(~scanf("%d%d",&a,&b)&&(a||b)) solve(a,b); return 0; }

转载请注明原文地址: https://www.6miu.com/read-76875.html

最新回复(0)