Task
Given an integer, , perform the following conditional actions:
- If is odd, print Weird
- If is even and in the inclusive range of to , print Not Weird
- If is even and in the inclusive range of to , print Weird
- If is even and greater than , print Not Weird
- Complete the stub code provided in your editor to print whether or not is weird.
using System;
class Solution
{
public static void Main(string[] args)
{
int N = Convert.ToInt32(Console.ReadLine().Trim());
if(N%2==0)
{
if(N>=2 && N<=5){
Console.WriteLine("Not Weird");
}
else if(N>=6 && N<=20){
Console.WriteLine("Weird");
}else{
Console.WriteLine("Not Weird");
}
} else{
Console.WriteLine("Weird");
}
}
}
Top comments (0)