PersonalCorpus 版 (精华区)

1139704 Big Guava ... 10368 Accepted
0:00.010 64 2002/10/03 04:07:56.950

bool tryit (int a, int b)
{
    if (a%b==0) return true;
    if ( (a/b)==1 ) return (!tryit(b,a%b)); else return true;
}

void main()
{
#ifndef ONLINE_JUDGE
    freopen("c:\\0acm\\uva\\contest9-29\\iB","r",stdin);
    freopen("c:\\0acm\\uva\\contest9-29\\oB","w",stdout);
#endif

    int i,j,k;
    bool res;
    while (1) {
        scanf("%d%d\n",&i,&j);
        if ((i==0)&&(j==0)) break;
        if (i>=j) res=tryit(i,j); else res=tryit(j,i);
        if (res) printf("Stan wins\n");else printf("Ollie wins\n");
    }
}
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.185毫秒