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对角线
如何我可以给高对角线的审美观? 换行后需要移位空格。