Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int n;
- cin >> n;
- vector <int> g[n];
- for(int i = 0; i < n; ++i) {
- for(int j = 0; j < n; ++j) {
- int x; cin >> x;
- g[j].push_back(x);
- cout << x << ' ';
- }
- cout << endl;
- }
- cout << endl;
- for(int i = 0; i < n; ++i) {
- sort(g[i].begin(), g[i].end());
- }
- for(int i = 0; i < n; ++i) {
- for(int j = 0; j < n; ++j) {
- cout << g[j][i] << ' ';
- }
- cout << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement