fork download
  1. #include <iostream>
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int main() {
  6. int n, m;
  7. cin >> n >> m;
  8. int ** x = new int *[n];
  9. for (int i = 0; i < n; i++)
  10. x[i] = new int[m];
  11. for (int i = 0; i < n; i++)
  12. for (int j = 0; j < m; j++)
  13. cin >> x[i][j];
  14. cout << m << " " << n;
  15. cout << endl;
  16. for (int j = 0; j < m; j++){
  17. for (int i = n - 1; i >= 0; i--)
  18. cout << x[i][j] << " ";
  19. cout << endl;
  20. }
  21. return 0;
  22. }
Success #stdin #stdout 0s 4256KB
stdin
1 1
2
stdout
1 1
2