Solution of 'Face the Direction' (Codechef)

Hi guys! It's been a while. I am back with my solution of the question - ' Face the Direction' from Codechef Starters 11. Any suggestion for me is highly appreciated. Happy Coding!


Question link: https://www.codechef.com/START11C/problems/FACEDIR


#include <bits/stdc++.h>
#define int long long int

using namespace std;

int32_t main()
{
    int t,x;
    cin>>t;
    while(t--){
        cin>>x;
        if(x%4==0cout<<"NORTH"<<'\n';
        else if((x-1)%4==0cout<<"EAST"<<'\n';
        else if((x-2)%4==0cout<<"SOUTH"<<'\n';
        else if((x-3)%4==0cout<<"WEST"<<'\n';
    }
    return 0;
}

Comments

Popular posts from this blog

Solution of 'Tom Riddle's Diary' (Codeforces)

Solution to the problem 'Red Light, Green Light' from Codechef

Solution to the problem 'The Squid Game' form Codechef