Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <iostream>
- #include <chrono>
- #include <random>
- int main()
- {
- const int n = 10;
- double tab[n];
- std::default_random_engine silnik;
- silnik.seed(std::chrono::system_clock::now().time_since_epoch().count());
- std::normal_distribution<double> wzrost(170, 10);
- double wynik;
- for (int i = 0; i < n; i++)
- {
- tab[i] = wzrost(silnik);
- }
- for (int p = 0; p < n; p++)
- {
- std::cout << tab[p] << std::endl;
- }
- int m = 0;
- for (int o = 1; o < n; o++)
- {
- if (tab[o] < tab[m])
- {
- double u = tab[m];
- m = o;
- tab[o] = u;
- }
- }
- //minimalna dla corach mniejszych tablic
- //tablica constxconst spirala liczb
- std::cout << std::endl<< tab[m];
- for(int i=0;i<n;i++)
- {
- tab[i];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement