/**
* @author 熙熙
* @2011-4-20
*/
public class JuZhenZhuanZhi {
/**
* @param args
*/
public static void main(String[] args) {
int a[][]={
{11,12,13}
,{21,22,23}
,{31,32,33}
};
System.out.println("转置前的矩阵:");
print(a);
zhuanZhi(a);
System.out.println("转置后的矩阵:");
print(a);
}
public static void zhuanZhi(int a[][]){
for(int i=0;i
a[i][j] = a[j][i];
a[j][i] = tem;
}
}
}
public static void print(int a[][]){
for(int i=0;i
for(;j System.out.print(a[i][j]+",");
}
System.out.println(a[i][j]);
}
}
}
public int[][] Transe(int[][] a){
int res[][] = new int[3][3];
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
res[i][j] = a[j][i];
}
}
return res;
}