O(1)空间复杂度实现n*n矩阵旋转90度,
#includeusing namespace std;#define ARRAY_SIZE 5void print_two_array (int a[][ARRAY_SIZE]) {cout << endl; for (int i=0; i << a[i][j] << ",";}cout << endl;}cout << endl;}void in_place_retation (int a[][ARRAY_SIZE]) { int swap = 0;const int n = ARRAY_SIZE;for (int k=0; k