Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺
1. 0-x之间的随机数:
Math.round(Math.random()*x);
2. x至y之间的随机数
Math.round(Math.random()*(y-x)+x);
3. 1-x之间的随机数:
Math.ceil(Math.random()*x);
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/167728.html原文链接:https://javaforall.net
