C++ - generate random numbers following normal distribution within range
问题 I need to generate random numbers that follow a normal distribution which should lie within the interval of 1000 and 11000 with a mean of 7000. I want to use the c++11 library function but I am not understanding how to generate the numbers within the interval. Can someone help? 回答1: You don't specify the standard deviation. Assuming a standard deviation of 2000 for the given interval you can try this: #include <iostream> #include <random> class Generator { std::default_random_engine generator