import java.util.Random;
public class Main {
public static void main(String[] args) {
Random random = new Random();
// 测试
for (int i = 0; i < 100; i++) {
// random.nextInt(51) 取 0 到 51之间(不包含51)的随机数
System.out.println(random.nextInt(51));
}
}
}
温馨提示:答案为网友推荐,仅供参考