Untitled
unknown
c_cpp
3 years ago
459 B
11
Indexable
#include <bits/stdc++.h>
using namespace std;
int main()
{
int x, y;
cin >> x >>y;
long long arr[x][y];
for (int i = 0; i < x; i++) {
for (int j = 0; j < y; j++)
cin >> arr[i][j];
}
printf("%d %d\n", y, x);
//rotate the matrix by 90 degree
for (int i = 0; i < y; i++)
{
cout << arr[x-1][i] << " ";
for (int j = x-2; j >= 0; j--)
cout << arr[j][i] << " ";
cout << endl;
}
return 0;
}
Editor is loading...