Skip to content

Commit 2fcbe81

Browse files
committed
Jan23
1 parent 77010fd commit 2fcbe81

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/jan4/rough.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22

33
public class rough {
44
public static void main(String[] args) {
5-
for(int row=1;row<=5;row++) {
6-
for(int col=1;col<=5;col++) {
7-
if(row+col>=6) {
8-
System.out.print(" * ");
9-
}
10-
else {
11-
System.out.print(" ");
5+
int num=5;
6+
for(int row=1;row<=num;row++) {
7+
for(int col=1;col<=2*num-1;col++) {
8+
if((col+row>num && col-row<=num-1)) {
9+
System.out.print(" * ");
10+
}
11+
else {
12+
System.out.print(" ");
13+
}
1214
}
15+
System.out.println();
1316
}
14-
System.out.println();
1517
}
16-
}
1718
}

0 commit comments

Comments
 (0)