旋转 90°
如果当前坐标为 ( i , j ) (i,j) (i,j),下一步就是 j = n − i + 1 j = n-i+1 j=n−i+1, i = j i = j i=j
旋转 45°
这样原本的长宽就要增长两倍
for (int i = 1; i <= n; i++)
for (int j = 1; j <= m; j++)
cin >> a[i + j - 1][n + j - i];
for (int i = 1; i <= n + m - 1; i++)
for (int j = 1; j <= n + m - 1; j++)
cout << a[i][j];
不管如何都 hate this…折磨