alphacademy-cpp/quito/matrix.cpp
2023-01-18 22:26:31 +01:00

22 lines
421 B
C++

#include <bits/stdc++.h>
using namespace std;
int main () {
int h, w;
cin >> h >> w;
vector<vector<int>> v(h, vector<int>(w));
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
cin >> v[i][j];
}
}
//cout<<endl;
for (int i = 0; i < w; i++) {
for (int j = 0; j < h; j++) {
cout << v[j][i]<< " ";
}
cout<<endl;
}
}