Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <ctime>
- #include <cstdlib>
- #include <iomanip>
- using namespace std;
- int main()
- {
- srand(time(NULL));
- double t[5][5];
- for(int i=0;i<5;i++)
- {
- for(int j=0;j<5;j++)
- {
- t[i][j]=-20+(double)rand()/RAND_MAX*(108);
- cout<<fixed<<setprecision(2)<<t[i][j]<<"\t";
- }
- cout<<endl;
- }
- cout << endl;
- for (int i = 0; i < 5; i++)
- {
- double minimum = 89;
- for (int j = 0; j < 5; j++)
- {
- if((t[i][j])<minimum)
- {
- minimum=t[i][j];
- }
- }
- int ile = 0;
- for (int j = 0; j < 5; j++)
- {
- if (t[i][j] == minimum)
- {
- ile++;
- }
- }
- cout << fixed<<setprecision(2)<< minimum << " w " << i+1 << " wierszu wystepuje " << ile << " raz/y"<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement