旋转图像
解题思路:轴对称与中心对称
class Solution { public void rotate(int[][] matrix) { int len = matrix.length; int temp = 0; for(int i=0;i<(len+1)/2;++i){ for(int j=0;j<len/2;++j){ temp = matrix[i][j]; matrix[i][j] = matrix[len-1-j][i]; matrix[len-1-j][i] = matrix[len-1-i][len-1-j]; matrix[len-1-i][len-1-j] = matrix[j][len-1-i]; matrix[j][len-1-i] = temp; } } } }