DEV Community

Cover image for Day 3: Intro to Conditional Statements
Vijay Chauhan
Vijay Chauhan

Posted on

Day 3: Intro to Conditional Statements

 'use strict';

  process.stdin.resume();
  process.stdin.setEncoding('utf-8');

  let inputString = '';
  let currentLine = 0;

  process.stdin.on('data', function(inputStdin) {
 inputString += inputStdin;
 });

 process.stdin.on('end', function() {
 inputString = inputString.split('\n');

 main();
});

 function readLine() {
 return inputString[currentLine++];
 }

  function main() {
  const N = parseInt(readLine().trim(), 10);
  if((N % 2 != 0)  || ((N > 5 && N <21) && N % 2 == 0)){
    console.log("Weird")
   } else {
    console.log("Not Weird")
  }

 }
Enter fullscreen mode Exit fullscreen mode

Top comments (0)