Advertisement
Evilerus

Untitled

Mar 7th, 2017
92
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 <cstdlib>
  3. #include <ctime>
  4.  
  5. using namespace std;
  6.  
  7. int main(int argc, char **argv)
  8. {
  9.     float f[1000][1000];
  10.     int i,j;
  11.     float min,max;
  12.     srand(time(NULL));
  13.     for (i=0; i<1000; i++)
  14.     {
  15.         for (j=0; j<1000; j++)
  16.         {
  17.             f[i][j]=rand();
  18.         }
  19.     }
  20.     min=f[0][0];
  21.     for (i=0; i<1000; i++)
  22.     {
  23.         for (j=0; j<1000; j++)
  24.         {
  25.             if (f[i][j]<min)
  26.             {
  27.                 min=f[i][j];
  28.             }
  29.         }
  30.     }
  31.     max=f[0][0];
  32.     for (i=0; i<1000; i++)
  33.     {
  34.         for (j=0; j<1000; j++)
  35.         {
  36.             if (f[i][j]>max)
  37.             {
  38.                 max=f[i][j];
  39.             }
  40.         }
  41.     }
  42.     cout << "min = " << min << ", max = " << max << endl;
  43.     return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement