java实现数组转置

** 数组转置**

编写程序将2行3列的数组行列置换复制给3行2列的数组(即数组的转置)。已经写了如下代码,请完善之:

class  y{
    public static void main(String[] args) throws Exception {
        int a[][]={{1,2,3},{4,5,6}};
        int b[][]=new int[3][2];
        for(int i=0;i<2;i++){
            for(int j=0;j<3;j++){
                _____________________;
            }    
        }            
    }
}


b[j][i] = a[i][j]
原文地址:https://www.cnblogs.com/a1439775520/p/13076979.html