Sort by

recency

|

1977 Discussions

|

  • + 0 comments

    import java.util.*;

    public class Solution { private static final Scanner scanner = new Scanner(System.in);

    public static void main(String[] args) {
        int N = scanner.nextInt();
        scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");
    
        if (N % 2 == 1) { // If N is odd
            System.out.println("Weird");
        } else { // If N is even
            if (N >= 2 && N <= 5) {
                System.out.println("Not Weird");
            } else if (N >= 6 && N <= 20) {
                System.out.println("Weird");
            } else if (N > 20) {
                System.out.println("Not Weird");
            }
        }
    
        scanner.close();
    }
    

    }

  • + 0 comments

    import java.io.; import java.math.; import java.security.; import java.text.; import java.util.; import java.util.concurrent.; import java.util.regex.*; public class Solution {

    private static final Scanner scanner = new Scanner(System.in);
    public static void main(String[] args) {
        int N = scanner.nextInt();
        scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");
        if(N % 2 == 1 ){
            System.out.println("Weird");
        }else if(N % 2 == 0 && N >= 2 && N <= 5 ){
            System.out.println("Not Weird");
        }else if(N % 2 == 0 && N >= 6 && N <= 20){
            System.out.println("Weird");
        }else if(N % 2 == 0 && N > 20){
            System.out.println("Not Weird");
        }
        scanner.close();
    }
    

    }

  • + 0 comments

    import java.io.; import java.math.; import java.security.; import java.text.; import java.util.; import java.util.concurrent.; import java.util.regex.*;

    public class Solution {

    private static final Scanner scanner = new Scanner(System.in);
    
    public static void main(String[] args) {
        int N = scanner.nextInt();
        scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");
         if (N%2 == 1) {
            System.out.println("Weird");}   
        else if (2<N && N<5 || N>20) {
            System.out.println("Not Weird");}
        else{
            System.out.println("Weird");}
        scanner.close();
    }
    

    }

  • + 0 comments

    If N is passed it a Even Number . Then check other condition of Range * then check N < 5 check the Event number from 2 to 5 between and Print " Not Weird" *Else If If the N is greater then 5 and less or equal to 20 then N<= 20 condtion check it. * If the N is greate then 20 the Esle condition is print If the Number is not pass the N % 2 == 0 that condition then print the Outer Else statement.

    if(N % 2 == 0 ){ if(N<5){

                System.out.println("Not Weird");
            }else if (N<=20){
                System.out.println("Weird");
            }else{
                System.out.println("Not Weird");
            }
        }else {
            System.out.println("Weird");
        }
    

    scanner.close(); }

  • + 0 comments

    //Took me FOREVER>:( but i finaly did it :D

    public static void main(String[] args) { int N = scanner.nextInt(); scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?"); if ((N % 2) == 0 && N >= 2 && N <= 5) { System.out.println("Not Weird");
    } if ((N % 2) == 0 && N >= 6 && N <= 20) { System.out.println("Weird"); } if ((N % 2) == 0 && N > 20) { System.out.println("Not Weird"); } if ((N % 2) == 1) { System.out.println("Weird"); }