时间限制: 1.0s
内存限制: 512.0MB
本题总分:15 分
package 省题2019;
import java.util.Scanner;
public class 旋转 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int row = sc.nextInt(); //获取行数
int col = sc.nextInt(); //获取列数
//构建一个二维数组
int[][] arr = new int[row][col];
//接收数据
for(int i = 0; i < row; i++) {
for(int j = 0; j < col; j++) {
arr[i][j] = sc.nextInt();
}
}
/**
* 输出的第一个数字下标为【row-1】【0】
* 第二个数字的下标为【row - 2】【0】
*/
for(int a = 0; a < col ; a++) {
for(int b = row -1; b >= 0; b--) {
System.out.print(arr[b][a]+" ");
}
System.out.println();
}
}
}