CCF图像旋转

内存超限90分

package gg;

import java.util.Scanner;

public class Main {

public static void main(String[] args) {
	Scanner scanner=new Scanner(System.in);
	int n,a,m;
	
	n=scanner.nextInt();
	m=scanner.nextInt();
	int k[][]=new int[n][m];
	int f[][]=new int[m][n];
	for (int i = 0; i <n; i++) {
		for (int j = 0; j < m; j++) {
			k[i][j]=scanner.nextInt();
			
		}
	}
	for (int i = 0; i < m; i++) {
		for (int j = 0; j < n; j++) {
			f[i][j]=k[j][m-1-i];
			System.out.print(f[i][j]+" ");
		}
		System.out.println();
	}
	
}

}

猜你喜欢

转载自blog.csdn.net/qq_29380377/article/details/85543112
今日推荐