From e14fc9af4e74a2ed05361224fd13ed4cc61479ec Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Fri, 3 Oct 2014 15:18:42 +0100 Subject: c,cc: rand.cc --- c,cc/rand.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 c,cc/rand.cc (limited to 'c,cc') diff --git a/c,cc/rand.cc b/c,cc/rand.cc new file mode 100644 index 0000000..6be97a6 --- /dev/null +++ b/c,cc/rand.cc @@ -0,0 +1,14 @@ +#include +#include + +int main() +{ + std::random_device rd; + std::mt19937 gen(rd()); + std::uniform_int_distribution<> dis(2, 3); + + for (int n=0; n<10; ++n) + std::cout << dis(gen) << ' '; + std::cout << '\n'; +} + -- cgit v1.2.3