[AppleScript] 纯文本查看 复制代码 public static void main(String[] args) {
HashSet<Integer> hs = new HashSet<Integer>();
Random random = new Random();
while (hs.size() < 5) {
//获取一个1-10之间的随机数
int temp = random.nextInt(9) + 1;
hs.add(temp);
}
for (Integer integer : hs) {
System.out.print(integer + " ");
}
} |