-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathu7.java
More file actions
26 lines (23 loc) · 729 Bytes
/
Copy pathu7.java
File metadata and controls
26 lines (23 loc) · 729 Bytes
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
import java.util.Scanner;
public class u7 {
public static void main(String[] args) {
for (int i = 1; i < 5; i++) {
for (int j = 0; j < 5 - i - 1; j++) {
System.out.print(" ");
}
for (int j = 0; j < 2 * i + 1; j++) {
System.out.print(i);
}
System.out.println();
}
// for(int i=10-2;i>=0;i--){
// for(int j=0;j<10-i-1;j++){
// System.out.print(" ");
// }
// for(int j=0;j<2*i+1;j++){
// System.out.print("*");
// }
// System.out.println(" ");
// }
}
}