-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatternpractise.java
More file actions
104 lines (81 loc) · 2.17 KB
/
patternpractise.java
File metadata and controls
104 lines (81 loc) · 2.17 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
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
103
104
import java.util.*;
public class patternpractise {
public static void main(String[] args) {
ArrayList al = new ArrayList();
al.add(100);
al.add(200);
al.add(300);
for(int i=0; i<al.size(); i++)
{
// System.out.println(al.get(i));
// Object o = al.get(i);
// System.out.println(o);
}
for(Object o : al)
{
System.out.println(o);
}
// for(int i = 0; i<5; i++){
// for(int j = 0; j<5; j++)
// {
// System.out.print("* ");
// }
// System.out.println();
// }
// for(int i = 0; i<5; i++){
// for(int j = 0; j<=i; j++)
// {
// System.out.print("* ");
// }
// System.out.println();
// }
// int n = 8;
// for (int i = 0; i<n+1; i++)
// {
// for (int j=0; j<n+1; j++)
// {
// if (i==0||i==n||j==0||i==n/2)
// {
// System.out.print("* ");
// }
// else
// {
// System.out.print(" ");
// }
// }
// System.out.println();
// }
// int n = 10;
// for(int i = 0; i < n+1; i++)
// {
// for(int j = 0; j < n+1; j++)
// {
// if(i == 0 && j<n/2 || i == n && j<n/2 || j == 0 || j == n/2 && i>0 && i<n)
// {
// System.out.print("* ");
// }
// else
// {
// System.out.print(" ");
// }
// }
// System.out.println();
// }
// int n=20;
// for (int i=0; i<n+1; i++)
// {
// for (int j=0; j<n+1; j++)
// {
// if (i==0 || j==0 || i+j<=n/2|| j==n || j-i>=n/2 || i==n || i-j>=n/2 || i+j>=n+n/2)
// {
// System.out.print("* ");
// }
// else
// {
// System.out.print(" ");
// }
// }
// System.out.println();
// }
}
}