随机数的范围10-20

(数据类型)(最小值+Math.random()(最大值-最小值+1))
例:
int i = (int)(10+Math.random()
(20-10+1))
从10到20的int型随数

猜你喜欢

转载自blog.csdn.net/qq_35577329/article/details/108524928
今日推荐