RosettaCodeData/Task/Random-numbers/C++/random-numbers-1.cpp

18 lines
319 B
C++
Raw Permalink Normal View History

2013-06-05 21:47:54 +00:00
#include <random>
#include <functional>
#include <vector>
#include <algorithm>
using namespace std;
2013-04-10 23:57:08 -07:00
int main()
{
2013-06-05 21:47:54 +00:00
random_device seed;
mt19937 engine(seed());
2013-10-27 22:24:23 +00:00
normal_distribution<double> dist(1.0, 0.5);
2013-06-05 21:47:54 +00:00
auto rnd = bind(dist, engine);
vector<double> v(1000);
generate(v.begin(), v.end(), rnd);
2013-04-10 23:57:08 -07:00
return 0;
}