> 数学 >
Math.floor(Math.random() * 7 +
人气:296 ℃ 时间:2020-06-16 13:01:57
解答
Math.random() 生成0和1之间的随机小数
Math.random() * 7 生成0和7之间的随机小数
Math.random() * 7 + 1生成0和8之间的随机小数
Math.floor(Math.random() * 7 + 1)生成0和8之间的随机整数,注意是整数,不是小数..
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版