Code geändert
This commit is contained in:
parent
ca5e4c0eca
commit
134441ff83
1 changed files with 17 additions and 7 deletions
|
@ -1,7 +1,17 @@
|
||||||
cout << "C++11:" << endl;
|
#include <iostream>
|
||||||
random_device seed;
|
#include <cstdlib>
|
||||||
mt19937 engine(seed()); // Generator
|
#include <ctime>
|
||||||
uniform_int_distribution<long> values(1, 10000); // Verteilung 1-10000
|
|
||||||
for( size_t i=0; i < 3; ++i) {
|
using std::cout;
|
||||||
cout << values(engine) << endl;
|
using std::endl;
|
||||||
}
|
inline void zufallszahl()
|
||||||
|
{
|
||||||
|
cout << RAND_MAX << endl;
|
||||||
|
|
||||||
|
srand((unsigned int) time(0));
|
||||||
|
|
||||||
|
for(int i=1; i<=20; i++){
|
||||||
|
cout << rand() % 6 +1 << " ";
|
||||||
|
cout << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue