试题编号: 201503-1
时间限制: 5.0s
内存限制: 256.0MB
1 package ccf_test2015_03; 2 3 import java.util.Scanner; 4 5 public class PictureXuanzhuan { 6 7 public static void main(String[] args) { 8 9 Scanner input = new Scanner(System.in); 10 11 int row = input.nextInt(); 12 13 int col = input.nextInt(); 14 15 input.nextLine(); 16 17 int [][]array = new int [row][col]; 18 19 for(int i = 0;i < row;i++){ 20 21 for(int j = 0;j < col;j++){ 22 23 array[i][j] = input.nextInt(); 24 } 25 input.nextLine(); 26 } 27 for(int j = col-1;j>=0;j--){ 28 29 for(int i = 0;i<row;i++){ 30 31 System.out.print(array[i][j] + " "); 32 } 33 System.out.println(); 34 } 35 36 } 37 38 }
运行结果:
原文:http://www.cnblogs.com/haimishasha/p/5331208.html