Advertisement
Tahamina_Taha

Java if_else

Sep 1st, 2019
495
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.81 KB | None | 0 0
  1. import java.io.*;
  2. import java.math.*;
  3. import java.security.*;
  4. import java.text.*;
  5. import java.util.*;
  6. import java.util.concurrent.*;
  7. import java.util.regex.*;
  8.  
  9. public class Solution {
  10.  
  11.  
  12.     public static void main(String[]args){
  13.   Scanner input = new Scanner(System.in);
  14.      
  15.           int a = input.nextInt();
  16.           if(a%2==1){
  17.               System.out.print("Weird");
  18.          
  19.           }
  20.          
  21.           else if(a%2==0 && a>=2 && a<=5){
  22.               System.out.print("Not Weird");
  23.           }
  24.          
  25.           else if (a%2==0&&a>=6&&a<=20)
  26.           {
  27.      System.out.print("Weird");
  28.           }
  29.           else if((a%2==0) && a>=20){
  30.               System.out.print("Not Weird");
  31.           }
  32.           else{
  33.               System.out.print("Weird");
  34.           }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement