fork download
  1. #include <iostream>
  2. #include <random>
  3.  
  4. int main()
  5. {
  6. std::random_device rd;
  7. std::mt19937 e2(rd());
  8. std::uniform_real_distribution<> dist(.05, .1);
  9.  
  10. double val = 100;
  11. for (int n = 0; n < 10; ++n) {
  12. std::cout << val * (1 + dist(e2)) << std::endl;
  13. }
  14. }
Success #stdin #stdout 0s 4352KB
stdin
Standard input is empty
stdout
108.425
107.806
105.981
109.701
107.663
109.404
107.677
109.127
106.902
105.529