fork(1) download
  1. #include <iostream>
  2. #include <random>
  3. #include <ctime>
  4. #include <functional>
  5.  
  6. int main() {
  7.  
  8. const int min = 0;
  9. const int max = 10;
  10.  
  11. auto random = std::bind(std::uniform_int_distribution<>(min, max),
  12. std::mt19937(time(NULL)));
  13.  
  14. for (int i = 0; i < 10; ++i) {
  15. std::cout << random() << std::endl;
  16. }
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0s 2928KB
stdin
Standard input is empty
stdout
7
6
0
10
10
5
5
1
9
10