输入两个整数之间的随机数
程序员文章站
2022-06-15 10:30:38
import java.util.Random;public class random { public static void main(String[] args) { Random ran=new Random(); int a=5; int b=100; int ran1=ran.nextI ......
import java.util.random;
public class random {
public static void main(string[] args) {
random ran=new random();
int a=5;
int b=100;
int ran1=ran.nextint(b-a)+a;
system.out.println(ran1);
}
}