Created
January 18, 2022 09:17
-
-
Save zhaofeng-shu33/284be6dbbbe292e01ac1c2963451bfde to your computer and use it in GitHub Desktop.
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> | |
int main() { | |
std::random_device dev; | |
std::default_random_engine generator(dev()); | |
std::uniform_real_distribution<double> distribution(0, 1); | |
for (int i = 0; i < 10; i++) { | |
double random_number = distribution(generator); | |
std::cout << random_number << std::endl; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment