Josif_tepe

Untitled

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