Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <vector>
- #include <string>
- #include <map>
- using namespace std;
- ifstream fin("input.txt");
- ofstream out("output.txt");
- int main()
- {
- int n, m;
- fin >> n >> m;
- vector<vector<int> > a(n, vector<int>(m));
- for (int i = 0; i < n; ++i)
- for (int j = 0; j < m; ++j)
- fin >> a[i][j];
- for (int j = 0; j < m; ++j, out << '\n')
- for (int i = 0; i < n; ++i)
- out << a[i][j] << ' ';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement