You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
615 B
28 lines
615 B
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
|
|
int main() {
|
|
int n, m, a[100][100] = {0}, b[100][100] = {0};
|
|
cin >> n >> m;
|
|
for (int i = 0; i < n; ++i) {
|
|
for (int j = 0; j < m; ++j) {
|
|
cin >> a[i][j];
|
|
}
|
|
}
|
|
//顺时针旋转90度
|
|
for (int i = 0; i < n; ++i) {
|
|
for (int j = 0; j < m; ++j) {
|
|
b[i][j] = a[abs(j - n + 1)][i];
|
|
}
|
|
}
|
|
//输出结果
|
|
for (int i = 0; i < n; ++i) {
|
|
for (int j = 0; j < m; ++j) {
|
|
cout << b[i][j] << " ";
|
|
}
|
|
cout << endl;
|
|
}
|
|
return 0;
|
|
}
|