public class Test { public static void main(String[] args) { int value = (int) (Math.random() * 90 + 10); //[0.0,1.0) -->[0.0,90.0) -->[10.0,100.0) -->[10,99] System.out.println(value); //公式:[a,b] : (int)(Math.random() * (b - a + 1) + a) } }
11-24
316
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)