69 89 109 139 169 189
100 120 140 160 180 200 转成
69    100
89    120
109   140
139   160
169   180
189   200

解决方案 »

  1.   

    for example
    int[][] a = {
        {69,89,109,139,169,189},
        {100,120,140,160,180,200}
    };int[][] b = new int[a[0].length][a.length];
    for (int i=0; i<a.length; i++) {
        for (int j=0; j<a[i].length; j++) {
            b[j][i] = a[i][j];
        }
    }for (int[] t : b) {
        System.out.println(Arrays.toString(t));
    }不管是数组还是List等集合,思路一样的
    List<List<Integer>> a = ...
    List<List<Integer>> b = new ArrayList<List<Integer>>();
    for (int i=0; i<a.get(0).size(); i++) {
        b.add(new ArrayList<Integer>());
    }for (int i=0; i<a.size(); i++) {
        for (int j=0; j<a.get(i).size(); j++) {
            b.get(j).add(a.get(i).get(j))
        }
    }
      

  2.   

    private static void test() {
    int[] a = {69,89,109,139,169,189};
    int[] b = {100,120,140,160,180,200};

    for(int i=0;i<a.length;i++){
    for(int j=0;j<b.length;j++){
    if(i==j){
    System.out.println(a[i]+" "+b[j]);
                                            break;
    }
    }
    }
    }