2017年5月25日

可恶的Math.random()

摘要: 生成随机数1-10 (包含1和10) 结果是这样的:Math.floor(Math.random()*10+1) 那么问题又来了 Math.floor(Math.random()*10)生成的只是0-9的整数 生成0-10 怎么生成? Math.floor(Math.random()*11) 啊啊啊 阅读全文

posted @ 2017-05-25 16:57 编程是个无底洞 阅读(901) 评论(0) 推荐(0) 编辑

导航