package edu.sjtu.erplab.io; import java.util.Random; public class RandomTest { public static void main(String[] args) { int max=20; int min=10; Random random = new Random(); int s = random.nextInt(max)%(max-min+1) + min; System.out.println(s); } }
2022-05-22 17:10:52
package edu.sjtu.erplab.io; import java.util.Random; public class RandomTest { public static void main(String[] args) { int max=20; int min=10; Random random = new Random(); int s = random.nextInt(max)%(max-min+1) + min; System.out.println(s); } }
下一篇:JAVA中的数据结构