Fare丶梦


私信TA

用户名:126913199

访问量:39357

签 名:

等  级
排  名 240
经  验 5921
参赛次数 0
文章发表 50
年  龄 22
在职情况 学生
学  校
专  业

  自我简介:

import java.util.Scanner;


public class Main {

        public static void rank(int[][] array){

                int[][] arr = new int[3][3];

                for(int i=0;i<3;i++){

                        for(int j=0;j<3;j++){

                                arr[i][j]=array[j][i];

                        }

                }

                for(int i=0;i<3;i++){

                        for(int j=0;j<3;j++){

                                array[i][j] = arr[i][j];

                                System.out.print(array[i][j]+" ");

                        }

                System.out.println();

                }

        }

        public static void main(String[] arg){

                Scanner sc = new Scanner(System.in);

                int[][] array = new int[3][3];

                for(int i=0;i<3;i++){

                        for(int j=0;j<3;j++){

                                array[i][j] = sc.nextInt();

                        }

                }

                rank(array);

        }

}


 

0.0分

0 人评分

  评论区