... HAVE U TRIED .... AT LEAST 3 TIMES ... OK U CAN SEE THIS ...

Tuesday, December 24, 2013

UVA-847 :: A Multiplication Game

#include <bits/stdc++.h>
using namespace std ;
int main ()
{
   long long int n , p , i ,op ;
    while (cin>>n)
    {
        p=1 ; op=0;
        while (p<n)
        {
            if (op%2==0) p=p*9 ;
            else p=p*2 ;
            op++ ;
        }
       
        if (op%2==1) cout<<"Stan wins."<<endl ;
        else cout<<"Ollie wins."<<endl ;
    }

    return 0 ;
}