You are viewing a single comment's thread. Return to all comments →
Hi everyone, This is my idea and my code, maybe it's not very optimal, but I submitted it and it is quite okay.
public class Main {
public static void main(String[] args) { // TODO Auto-generated method stub Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); if (1 <= n && n <= 100) { if (((n % 2 == 0) && n > 2 && n < 5) || (n > 20 && n % 2 == 0)) { System.out.print("Not Weird"); } if ((n % 2 == 0) && n > 6 && n <= 20 || n % 2 !=0) { System.out.print("Weird"); } } }
}
Seems like cookies are disabled on this browser, please enable them to open this website
Java If-Else
You are viewing a single comment's thread. Return to all comments →
Hi everyone, This is my idea and my code, maybe it's not very optimal, but I submitted it and it is quite okay.
public class Main {
}