@rpdm read my post again, it's the implementation of the same algo.
And remember:
1. chalson wanted to get the numbers as input, so you won't require the time() and srand() and the inclusion of header files <cstdlib> and <ctime>
2. The values required are float, not integers.
3. your main() should return a value.
rpdm commented: All bad points. Thanks for assuming I'm an idiot. +0