-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDisplayIN.java
More file actions
65 lines (61 loc) · 1.86 KB
/
Copy pathDisplayIN.java
File metadata and controls
65 lines (61 loc) · 1.86 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
I N
***456*789X*
* * * *
* * * *
* * **
*** * *
*/
package forquiz;
/**
*
* @author oam
*/
public class DisplayIN {
public static void main(String[] args) {
for (int i = 0; i < 5; i++) {
for (int j = 1; j <= 12; j++) {
switch (i) {
case 0:
if (j == 1 || j == 2 || j == 3 || j == 7 || j == 12) {
System.out.print("*");
} else {
System.out.print(" ");
}
break;
case 1:
if (j == 2 || j == 7 || j == 9 || j == 12) {
System.out.print("*");
} else {
System.out.print(" ");
}
break;
case 2:
if(j==2 || j==7 || j==10 || j==12){
System.out.print("*");
}
else{
System.out.print(" ");
}
break;
case 3:
if(j==2 || j==7 || j==11 || j==12){
System.out.print("*");
}
else{
System.out.print(" ");
}
break;
case 4:
if (j == 1 || j == 2 || j == 3 || j == 7 || j == 12) {
System.out.print("*");
} else {
System.out.print(" ");
}
break;
}
}
System.out.println();
}
}
}