diff --git a/zufallszahlen.cpp b/zufallszahlen.cpp index eda888f..e93d99f 100644 --- a/zufallszahlen.cpp +++ b/zufallszahlen.cpp @@ -1,7 +1,17 @@ -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 +#include +#include +#include + +using std::cout; +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; + } +}