Saturday, 25 March 2017

Hacker Rank Solution Program In C++ For " Day 3: Intro to Conditional Statements "

Problem :- Day 3: Intro to Conditional Statements

Submit Your Solution Here :- Click Here

Copy The Color Code and paste it into hackerrank Editor .

Solution :-

#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
using namespace std;


int main(){
    int N;
    cin >> N;
    if(N%2==0)
        {
        if(N>=2 && N<=5)
            cout<<"Not Weird";
        else if(N>=6 && N<=20)
            cout<<"Weird";
            else
            cout<<"Not Weird";
    }
    else
        cout<<"Weird";
    return 0;
}

Output :-

Hacker Rank Solution Program In C++ For " Day 3: Intro to Conditional Statements "

No comments:
Write comments

Recommended Posts × +