- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJavaIfElse.java
More file actions
Latest commit
24 lines (19 loc) · 615 Bytes
/
Copy pathJavaIfElse.java
File metadata and controls
24 lines (19 loc) · 615 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
packageIntroduction;
importjava.util.*;
publicclassJavaIfElse {
privatestaticfinalScannerscanner = newScanner(System.in);
publicstaticvoidmain(String[] args) {
intN = scanner.nextInt();
scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");
scanner.close();
if (N % 2 == 1) {
System.out.println("Weird");
} elseif (N >= 2 && N <= 5) {
System.out.println("Not Weird");
} elseif (N >= 6 && N <= 20) {
System.out.println("Weird");
} else {
System.out.println("Not Weird");
}
}
}