Last active
September 5, 2017 16:52
-
-
Save sh-cho/4f74f6559f65e07cea2f3ca8f35ca5d9 to your computer and use it in GitHub Desktop.
c++11 random int
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <random> | |
#include <iostream> | |
using namespace std; | |
int main() { | |
std::random_device rd; | |
std::mt19937 rng(rd()); | |
std::uniform_int_distribution<int> uni(0, 10000000); | |
for (int i = 0; i < 10; ++i) { | |
cout << uni(rng) << endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment