From eb0df7ee84695bef68e85b3f3bb9566a6fb96a6a Mon Sep 17 00:00:00 2001 From: Marc Date: Mon, 14 Jun 2021 19:14:12 +0200 Subject: [PATCH] zufallszahlen.cpp Ein Zufallszahlengenerator --- zufallszahlen.cpp | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 zufallszahlen.cpp diff --git a/zufallszahlen.cpp b/zufallszahlen.cpp new file mode 100644 index 0000000..eda888f --- /dev/null +++ b/zufallszahlen.cpp @@ -0,0 +1,7 @@ +cout << "C++11:" << endl; + random_device seed; + mt19937 engine(seed()); // Generator + uniform_int_distribution values(1, 10000); // Verteilung 1-10000 + for( size_t i=0; i < 3; ++i) { + cout << values(engine) << endl; + } \ No newline at end of file