forked from sPredictorX1708/Ultimate-Java-Resources
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJavaIfElse.java
More file actions
29 lines (24 loc) · 407 Bytes
/
JavaIfElse.java
File metadata and controls
29 lines (24 loc) · 407 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
25
26
27
28
29
import java.util.Scanner;
/**
*
* @author Haseeb Ansari
*
*/
public class JavaIfElse {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
String ans = "";
if (n % 2 == 1) {
ans = "Weird";
} else {
if (n >= 6 && n <= 20) {
ans = "Weird";
} else {
ans = "Not Weird";
}
}
System.out.println(ans);
sc.close();
}
}