File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,18 @@ public static void main(String[] args) {
10
10
}
11
11
}
12
12
13
+ class Pattern1 {
14
+ public static void main (String [] args ) {
15
+ int n = 5 ;
16
+ for (int line = n ; line >= 1 ; line --) {
17
+ for (int number = 1 ; number <= line ; number ++) {
18
+ System .out .print (number );
19
+ }
20
+ System .out .println ();
21
+ }
22
+ }
23
+ }
24
+
13
25
class Pattern2 {
14
26
public static void main (String [] args ) {
15
27
for (int line = 0 ; line < 5 ; line ++) {
@@ -78,3 +90,16 @@ public static void main(String[] args) {
78
90
}
79
91
}
80
92
}
93
+
94
+ class Pattern8 {
95
+ public static void main (String [] args ) {
96
+ int num = 1 ;
97
+ for (int line = 1 ; line <= 5 ; line ++) {
98
+ for (int number = 1 ; number <= line ; number ++) {
99
+ System .out .print (num );
100
+ num += 1 ;
101
+ }
102
+ System .out .println ();
103
+ }
104
+ }
105
+ }
You can’t perform that action at this time.
0 commit comments