要生成在[min,max]之間的隨機整數
import java.util.Random;
public class RandomTest {
public static void main(String[] args) {
int min=10;
int max=20;
Random random = new Random();
//int s = random.nextInt(max)%(max-min+1) + min;
int s = random.nextInt(max-min+1) + min;
System.out.println(s);
}
}
