-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAsteriscos6.java
More file actions
34 lines (31 loc) · 877 Bytes
/
Asteriscos6.java
File metadata and controls
34 lines (31 loc) · 877 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
27
28
29
30
31
32
33
34
public class Asteriscos6 {
public static void main(String[] args){
int m = 1;
int i, j, k, n = 1;
int height = 3;
int width = 4;
int space = width * 5;
for(i = 1; i <= height; i++){
for(j = m; j <= width; j++){
for(k = space; k >= j; k--){
System.out.print(" ");
}
for(n = 1; n <= j; n++){
System.out.print("* ");
}
System.out.println();
}
m = m + 2;
width = width + 2;
}
for(j = 1; j <= 4; j++){
for(k = space - 3; k >= 1; k--){
System.out.print(" ");
}
for(n = 1; n <= 4; n++){
System.out.print("* ");
}
System.out.println();
}
}
}