Advertisement
Garey

зад

Nov 2nd, 2017
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.   double C[4][4];
  7.  
  8.   for (int i = 0; i < 4; i++) {
  9.     for (int j = 0; j < 4; j++) {
  10.       cout << "Enter C[" << i << "][" << j << "]: ";
  11.       cin >>C[i][j];
  12.     }
  13.   }
  14.  
  15.   double min[4] = {C[0][0], C[0][1], C[0][2], C[0][3]};
  16.  
  17.   for (int i = 0; i < 4; i++) {
  18.     for (int j = 0; j < 4; j++) {
  19.       if(C[i][0] < min[0])
  20.         min[0] = C[i][0];
  21.  
  22.       if(C[i][1] < min[1])
  23.         min[1] = C[i][1];
  24.  
  25.       if(C[i][2] < min[2])
  26.         min[2] = C[i][2];
  27.  
  28.       if(C[i][3] < min[3])
  29.         min[3] = C[i][3];
  30.  
  31.       cout << C[i][j] << "  ";
  32.     }
  33.     cout << endl;
  34.   }
  35.  
  36.   for (int i = 0; i < 4; i++) {
  37.     cout << min[i] << "  ";
  38.   }
  39.  
  40.   return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement