0~10的随机数 10*Math.random() 0~7的随机数 7*Math.random() 0~2的随机数 2*Math.random() 转载于:https://www.cnblogs.com/coding4/p/5908775.html