package hanqi;import java.util.Scanner;public class Test7 { public static void main(String[] args) { int[][] m = { {3,2,6},{6,8,2,10},{5},{12,3,23}}; int[] n; int len = 0; for(int i = 0;i < m.length;i++){ len += m[i].length; //获取长度 } //复制元素 n = new int[len]; int index = 0; for(int i = 0;i < m.length;i++){ for(int j = 0;j < m[i].length;j++){ n[index++] = m[i][j]; } } int z; for(int k=0;kn[j]) { z=n[k]; n[k]=n[j]; n[j]=z; } } } System.out.println(n[0]); System.out.println(n[len-1]); }}