标签:
import java.util.*; public class Transform { public int[][] transformImage(int[][] matrix, int n) { // write code here n = matrix.length; int limit = (n-1)/2; for(int i=0;i<=limit; i++){ for(int j=i;j<n-i-1;j++){ int temp = matrix[i][j]; matrix[i][j] = matrix[n-1-j][i]; matrix[n-1-j][i] = matrix[n-1-i][n-1-j]; matrix[n-1-i][n-1-j] = matrix[j][n-1-i]; matrix[j][n-1-i] = temp; } } return matrix; } }
1.6---旋转二维数组,旋转图像像素,旋转矩阵,90度(CC150)
标签:
原文地址:http://www.cnblogs.com/yueyebigdata/p/5051822.html