用java做的彩票
自动选号系统package com.cp;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Random;
public class CaiPiaoMach {
private int max;
private int count;
public CaiPiaoMach(int max, int count) {
super();
this.max = max;
this.count = count;
}
public int[] choujiangMethod()
{
if(count>=max)
{
System.out.println("您设定的抽奖条件有错误!");
return null;
}
//准备好摇奖机里的抽奖小球
ArrayList list=new ArrayList();
for(int i=1;i<=max;i++)
{
list.add(i);
}
//随机生成号码位置
Random random=new Random();
//存放结果集合
int[] result=new int[count];
for(int j=0;j
2021-06-17 15:38:46
4KB
彩票系统
1