Codeforces Solution 82A Double Cola

#include<iostream>
using namespace std;
int main()
{
    int n,c=0;
    cin>>n;
    while(n>5)
    {
        n=n/2;
        n-=2;
    }
    if(n==1)
        cout<<"Sheldon"<<endl;
    else if(n==2)
        cout<<"Leonard"<<endl;
    else if(n==3)
        cout<<"Penny"<<endl;
    else if(n==4)
        cout<<"Rajesh"<<endl;
    else if(n==5)
        cout<<"Howard"<<endl;

    return 0;
}

Comments

Post a Comment

Popular posts from this blog

Codeforces Solution 230B T-primes

Uri Solution 2747 Output 1