package demo01;
import java.util.Scanner;
public class demo24 {
public static void main(String[] args){ Scanner sc = new Scanner(System.in); System.out.print("请输入第一个数:"); int start = sc.nextInt(); System.out.print("请输入最后一个数:"); int end = sc.nextInt(); for(int x=0;x<100;x++){ int number = getRandom(start,end); System.out.println(number); } } public static int getRandom(int start,int end){ //int number = (int)(Math.random()*end)+start;int number = (int)(Math.random()*(end-start+1))+start;
return number; } }