阅读背景:

计算数组中随机整数的平均值

来源:互联网 

I need to generate a specified number of random integers between any two values specified by the user (example, 12 numbers all between 10 and 20), and then calculate the average of the numbers. The problem is if I ask for it to generate 10 numbers, it will only generate 9 (shown in output.) Also, if I enter a max range of 100 and min range of 90, the program will still generate #'s like 147, etc that are over the max range... did I mess up the random number generator? Can someone help? I need to generate a specified number of random




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: