public class Abc {
public static void main(String[] args) {
System.out.println("请输入您要随机的双色球数量:");
Scanner scanner=new Scanner(System.in);
int x=scanner.nextInt();
System.out.println(x);
for(int i = 0;i Random r = new Random(); Set<integer> setRed = new HashSet<>();/<integer> while(setRed.size()<6){ setRed.add(r.nextInt(33)+1); } int blueBall = r.nextInt(16)+1; System.out.print("红:"); for(Integer redNum:setRed){ System.out.print(redNum+" "); } System.out.println("蓝:"+blueBall); } } }
閱讀更多 河神啊哈 的文章