Untitled

mail@pastecode.io avatar
unknown
c_cpp
a year ago
459 B
5
Indexable
Never
#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;
}