Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- int main() {
- int row, col, el;
- cin >> row >> col;
- vector<vector<int>> matrix;
- for (int i = 0; i < row; i++) {
- vector<int> currentRow;
- for (int j = 0; j < col; j++) {
- cin >> el;
- currentRow.push_back(el);
- }
- matrix.push_back(currentRow);
- }
- for (int i = 0; i < col; i++) {
- int sum = 0;
- for (int j = 0; j < row; j++) {
- sum += matrix[j][i];
- }
- cout << sum << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement