Josif_tepe

Untitled

Feb 10th, 2026
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int n, m;
  6.     cin >> n >> m;
  7.    
  8.     int mat[n][m];
  9.     for(int i = 0; i < n; i++) {
  10.         for(int j = 0; j < m; j++) {
  11.             cin >> mat[i][j];
  12.         }
  13.     }
  14.    
  15.    
  16.    
  17.     for(int j = 0; j < m; j++) {
  18.        
  19.         int zbir = 0;
  20.         for(int i = 0; i < n; i++) {
  21.             zbir += mat[i][j];
  22.         }
  23.        
  24.         cout << zbir << endl;
  25.        
  26.     }
  27.     return 0;
  28. }
  29.  
Advertisement
Add Comment
Please, Sign In to add comment