|
|
@ -71,4 +71,14 @@ void initialisiereZufallsgenerator() { |
|
|
|
|
|
|
|
//18 |
|
|
|
int generiereZufallszahl(int min, int max) { |
|
|
|
return min + (int)((double)rand() / (RAND_MAX + 1) * (max - min + 1)); |
|
|
|
return min + (int)((double)rand() / (RAND_MAX + 1) * (max - min + 1)); |
|
|
|
|
|
|
|
|
|
|
|
//19 |
|
|
|
char generiereZufallsOperator() { |
|
|
|
char operatoren[] = {'+', '-', '*', '/'}; |
|
|
|
int index = rand() % 4; |
|
|
|
return operatoren[index]; |
|
|
|
|
|
|
|
|
|
|
|
|