AcWing 3174. 旋转-Java
原题链接
简单
作者:
zlnnjit
,
2021-03-21 14:05:26
,
所有人可见
,
阅读 277
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int row = sc.nextInt(), col = sc.nextInt();
int[][] arr = new int[row][col];
for (int r = 0; r < row; r++) {
for (int c = 0; c < col; c++) {
arr[r][c] = sc.nextInt();
}
}
for (int c = 0; c < col; c++) {
for (int r = row - 1; r >= 0; r--) {
System.out.print(arr[r][c] + " ");
}
System.out.println();
}
}
}