-
Notifications
You must be signed in to change notification settings - Fork 0
/
exo_2013_logo.java
102 lines (94 loc) · 2.14 KB
/
exo_2013_logo.java
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
public class exo_2013_logo
{
public static void main (String []args)
{
for (int i = 1; i <= 13; i++)
{
for(int j = 1; j <= 18; j++)
{
if(i==1||i==13)
{
if(j==3 || j==4 || j==12)
{
System.out.print("x");
}
else
{
System.out.print(" ");
}
}
else if(i==2 || i==12)
{
if(j==3 || j==5 || j==11 || j ==13)
{
System.out.print("o");
}
else
{
System.out.print(" ");
}
}
else if(i==3 || i==11)
{
if(j==4 || j==6 || j==10 || j ==12 || j==14)
{
System.out.print("x");
}
else
{
System.out.print(" ");
}
}
else if(i==4|| i==10)
{
if(j==5 || j==7 || j==9 || j==11 || j==13 || j==15)
{
System.out.print("o");
}
else
{
System.out.print(" ");
}
}
else if(i==5 || i==9)
{
if(j==6 || j==8 || j==10 || j==14 || j==16)
{
System.out.print("x");
}
else
{
System.out.print(" ");
}
}
else if(i==6 || i==8)
{
if(j==2 || j==3 || j==4 || j==5||j==6 || j==9|| j==15 || j==17)
{
System.out.print("o");
}
else
{
System.out.print(" ");
}
}
else if(i==7)
{
if(j==1 || j==9 || j==15|| j==18)
{
System.out.print("x");
}
else
{
System.out.print(" ");
}
}
else
{
System.out.print(" ");
}
}
System.out.println();
}
}
}