Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- int main(int argc, char **argv)
- {
- float f[1000][1000];
- int i,j;
- float min,max;
- srand(time(NULL));
- for (i=0; i<1000; i++)
- {
- for (j=0; j<1000; j++)
- {
- f[i][j]=rand();
- }
- }
- min=f[0][0];
- for (i=0; i<1000; i++)
- {
- for (j=0; j<1000; j++)
- {
- if (f[i][j]<min)
- {
- min=f[i][j];
- }
- }
- }
- max=f[0][0];
- for (i=0; i<1000; i++)
- {
- for (j=0; j<1000; j++)
- {
- if (f[i][j]>max)
- {
- max=f[i][j];
- }
- }
- }
- cout << "min = " << min << ", max = " << max << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement