UVA 847 - A Multiplication Game

UVA Sep 01, 2020

Problem PDF

Solution:

#include 
int main()
{
    long long int n,p;
    while(scanf("%lld",&n)!=EOF)
    {
        p=1;
        while(p=n)
            {
                puts("Stan wins.");
                break;
            }
            p*=2;
            if(p>=n)
            {
                puts("Ollie wins.");
                break;
            }
        }
    }
}

https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/847/847.cpp

Tags

Shipu Ahamed

CSPO® | Partly Product, Project Manager and Partly Software Engineer.

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.