public class Main {
public static void main(String[] args) {
int array[][] = {
{2, 3, 4, 5, 6},
{2, 3, 4, 5, 6},
{2, 3, 4, 5, 6},
{2, 3, 4, 5, 6},
{2, 3, 4, 5, 6},
};
int i, j;
{
for (i = 0; i <5; i++) {
for (j = 0+i; j < 5; j++) {
System.out.print(array[i][j] + " ");
}
System.out.println();
}
}
}
}
見上文:example image對角線
如何我可以給高對角線的審美觀? 換行後需要移位空格。