package test;
import java.util.Scanner;
public class ArrayTest {
public int[][] arr(int n){
int[][] t = new int[n][n];
int k = 1;
for(int i=0;i
}
}
for(int i=0;i
int m = t[i][j];
t[i][j] = t[i][n-1];
t[i][n-1] = m;
}
}
}
return t;
}
public static void main(String[] args) {
Scanner console = new Scanner(System.in);
int n = console.nextInt();
int[][] t = new ArrayTest().arr(3);
for(int i=0;i
}
System.out.println();
}
}
}
你这排数字根本就没有规律的,矩阵一般都是二位数组了什么的。我看了半天没看出你的这排数字的规律。看不出算法怎么得到啊....