*/
public class YangHuiSanJiaoXingDemo {
// 列印二維數組的方法:
public static void printArray2(int[][] arr) {
for (int x = 0; x < arr.length; x++) {
for (int y = 0; y <= x; y++) {
System.out.print(arr[x][y] + "\t");
}
System.out.println();
}
}
//列印一般的二維數組的方法
public static void print2(int[][] arr2) {
for (int x = 0; x < arr2.length; x++) {
for (int y = 0; y < arr2[x].length; y++) {
System.out.print(arr2[x][y] + ", ");
}