fork download
  1. #include <iostream>
  2. #include <random>
  3. #include <functional>
  4. #include <algorithm>
  5. #include <iterator>
  6.  
  7. #include <ctime>
  8.  
  9. int main() {
  10.  
  11. // Limity
  12. int min = 0;
  13. int max = 1e6;
  14.  
  15. // Generator liczb losowych.
  16. auto gen = std::bind(std::uniform_int_distribution<>(min, max),
  17. std::mt19937(std::time(NULL)));
  18.  
  19. // 10 liczb.
  20. std::generate_n(std::ostream_iterator<double>(std::cout, " "), 10, gen);
  21.  
  22. return 0;
  23. }
Success #stdin #stdout 0s 2928KB
stdin
Standard input is empty
stdout
761734 694222 541518 888269 20959 233178 398845 357183 279876 563216