for(int i = -4; i <= 4; i++){
for(int j = -4; j<= 4; j++){
System.out.print((Math.abs(i) + Math.abs(j) <= 4) ?"*":" ");
}
System.out.println();
}
打印菱形
最新推荐文章于 2022-01-07 23:11:23 发布
for(int i = -4; i <= 4; i++){
for(int j = -4; j<= 4; j++){
System.out.print((Math.abs(i) + Math.abs(j) <= 4) ?"*":" ");
}
System.out.println();
}