zufallszahlen.cpp
Ein Zufallszahlengenerator
This commit is contained in:
parent
ab8211c545
commit
eb0df7ee84
1 changed files with 7 additions and 0 deletions
7
zufallszahlen.cpp
Normal file
7
zufallszahlen.cpp
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
cout << "C++11:" << endl;
|
||||||
|
random_device seed;
|
||||||
|
mt19937 engine(seed()); // Generator
|
||||||
|
uniform_int_distribution<long> values(1, 10000); // Verteilung 1-10000
|
||||||
|
for( size_t i=0; i < 3; ++i) {
|
||||||
|
cout << values(engine) << endl;
|
||||||
|
}
|
Loading…
Reference in a new issue