Write a program that takes a positive integer command-line argument x
and continuously generates random integers between 0
and x-1
(inclusive) until each integer
in this range has been generated at least once. The program should display all the numbers that are generated,
and finally report how many numbers were generated in total.
Running your program with the argument 4
might lead to the following output:
Generating random numbers:
0, 1, 1, 0, 0, 1, 0, 3, 3, 0, 1, 2
I had to generate 12 random numbers between 0 and 3 to have produced all such numbers at least once.
Random number generation can be performed as in question 4c70. Command-line argument processing can be performed as in question 98e3.