Advertisement
Josif_tepe

Untitled

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