alphacademy-cpp/quito/matrix.cpp

22 lines
421 B
C++
Raw Normal View History

2023-01-18 21:26:31 +00:00
#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;
}
}