Advertisement
Josif_tepe

Untitled

Feb 18th, 2021
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 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 i = 0; i < n; i++) {
  18.         int najmal = 2e9;
  19.         for(int j = 0; j < m; j++) {
  20.             if(mat[i][j] < najmal) {
  21.                 najmal = mat[i][j];
  22.             }
  23.         }
  24.         cout << najmal << endl;
  25.        
  26.     }
  27.     return 0;
  28. }
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement