POJ 2505

时间:2022-09-04 22:19:19
 #include<iostream>
#include<stdio.h>
using namespace std; int main()
{
//freopen("acm.acm","r",stdin);
unsigned num;
unsigned mod;
unsigned begin;
unsigned end;
int i;
i = ;
while(cin>>num)
{
begin = ;
end = ;
if(num >= && num <= )
{
cout<<"Stan wins."<<endl;
continue;
}
for(i = ; i < num; ++ i)
{
begin *= ;
end = begin*;
if(num >= begin+ && num <= end)
{
cout<<"Ollie wins."<<endl;
break;
}
begin = end;
end = begin*;
if(num >= begin+ && num <= end)
{
cout<<"Stan wins."<<endl;
break;
} }
}
}
/*
1 ----- 9 先胜
9+1 ------ 9*2 先负
9*2+1 ---- 9*2*9 先胜
9*2*9+1 ---- 9*2*9*2 先负
*/