矩阵的旋转与翻转
作者:
愿得一尹心
,
2023-12-31 22:35:28
,
所有人可见
,
阅读 63
for(int i = 0; i < n;i ++)
{
for(int j = n - 1; j >= 0;j --)
{
cout << a[j][i] << ' ';
}
cout << endl;
}
for(int i = n - 1; i >= 0;i --)
{
for(int j = n - 1; j >= 0;j --)
{
cout << a[j][i] << ' ';
}
cout << endl;
}
for(int i = n - 1; i >= 0;i --)
{
for(int j = 0; j < n;j ++)
{
cout << a[j][i] << ' ';
}
cout << endl;
}
for(int i = n - 1; i >= 0;i --)
{
for(int j = 0; j < n;j ++)
{
cout << a[i][j] << ' ';
}
cout << endl;
}
for(int i = n - 1; i >= 0;i --)
{
for(int j = n - 1; j >= 0;j --)
{
cout << a[i][j] << ' ';
}
cout << endl;
}