标签:
Description
25 7 11 7 4 7 4 3 1 3 1 0
Input
Output
Sample Input
34 12 15 24 0 0
Sample Output
Stan wins Ollie wins#include <cstdio> #include <algorithm> using namespace std; int main() { int a, b; while (scanf("%d%d", &a, &b) && a + b) { bool flag = true; while (true) { if (a > b) swap(a, b); if (b % a == 0) break; if (b - a > a) break; b -= a; flag = !flag; } if (flag) puts("Stan wins"); else puts("Ollie wins"); } return 0; }
版权声明:本文为博主原创文章,未经博主允许不得转载。
标签:
原文地址:http://blog.csdn.net/kl28978113/article/details/47174103