-2
if (shape.equals("diagonal")){
for (int row = 0; row <= size; row ++){
for (int col = 0 ; col < size; col ++){
if (col % 4 == 0){
System.out.print("*");
} else {
System.out.print("$");
}
}
System.out.println();
}
}
*$$$*$$$*$$$*$$$*
$*$$$*$$$*$$$*$$$
$$*$$$*$$$*$$$*$$
same as it go down
我的目標是打印上面的代碼,它由17產量繼續直到17創建遞增斜
更換
目前尚不清楚在所有你問的問題 – bengoesboom