-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSolution.java
More file actions
42 lines (35 loc) · 1 KB
/
Solution.java
File metadata and controls
42 lines (35 loc) · 1 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class solution {
public static void main(String[] args)
{
int n;
String ans="";
for(n=1;n<=100;n++)
{
if(n%2==1)
{
ans = "Weird";
System.out.println(ans);
}
else if(n%2==0 && n<=5)
{
ans="Not weird"; //Complete the code
System.out.println(ans);
}
else if(n%2==0 && n<=20)
{
ans="weird"; //Complete the code
System.out.println(ans);
}
else
{
ans="Not weird"; //Complete the code
System.out.println(ans);
}
}
}
}