summaryrefslogtreecommitdiff
path: root/c,cc/rand.cc
diff options
context:
space:
mode:
Diffstat (limited to 'c,cc/rand.cc')
-rw-r--r--c,cc/rand.cc14
1 files changed, 14 insertions, 0 deletions
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 <iostream>
+#include <random>
+
+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';
+}
+