Advertisement
Garey

Random Number Distribution

Dec 18th, 2017
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include <iostream>
  2. #include <random>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     random_device rd;
  9.     mt19937 gen(rd());
  10.     uniform_int_distribution<> dis(100000, 999999);
  11.  
  12.     for (int n = 0; n<10; ++n)
  13.         cout << dis(gen) << '\n';
  14.    
  15.     cout << '\n';
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement