Sort by

recency

|

2037 Discussions

|

  • + 0 comments
        if(n%2!=0){
            System.out.println("Weird");
        }
        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");
        }
    
  • + 0 comments

    System.out.println((N % 2 == 1 || (N >= 6 && N <= 20)) ? "Weird" : "Not Weird");

  • + 0 comments

    // CONDITIONS FOR WEIRD

    if(n%2!=0 || n>=6 && n<=20 ){ System.out.println("Weird"); }

    // CONDITIONS FOR NOT WEIRD

    else if (n>=2 && n<=5 || n>20){ System.out.println("Not Weird"); }

  • + 0 comments

    import java.util.Scanner;

    public class Solution {

    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    

    String res = (!(n%2==0)) ? "Weird" : (n%2==0 && ((2 <= n) && (n<= 5))) ? "Not Weird" : (n%2==0 && ((6 <= n) && (n<= 20))) ? "Weird" : "Not Weird"; System.out.println(res); sc.close(); } }

  • + 0 comments

    if (N %2==0) { if (N >= 2 && N <= 5) { System.out.println("Not Weird"); } else if (N >= 6 && N <= 20) { System.out.println("print Weird"); } else if ( N >20 ){ System.out.println("Not Weird"); } } else { System.out.println("Weird"); }