/**
* @author: maple
* @date : 09-02
*/
public class TransArray {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int a[][]={{1,2,3},{4,5,6},{7,8,9}};//这里是一个已知数组
//当然你也可以用Math.random()来产生随机数组
for(int i=0;i<a.length;i++)
{
for(int j=0;j<a[i].length;j++)
{
System.out.print(a[i][j]+" ");
}
System.out.print("\n");
}
////////////////////////////////////////////
System.out.print("\n");
trans pose=new trans();
a=pose.transpose(a);
for(int i=0;i<a.length;i++)
{
for(int j=0;j<a[i].length;j++)
{
System.out.print(a[i][j]+" ");
}
System.out.print("\n");
}
}
/**
* name suiji()
* Description this method is used for produceing a array
* @param date 23th,Nov
* @exception no exception
* @return no return value
*/
public static void suiji() {//这个函数是用于产生随机数组的,这样看起来也更通俗些,在main()里调用就行了
for (int i = 0; i < 10; i++) {
myarray[i] = (int) (Math.random() * 10);
System.out.print(myarray[i] + " ");
}
}
}