import java.util.ArrayList;
import java.util.Random;
public class ShuangSeQiu {
/**
* @param args
*/
public static void main(String[] args) {
ArrayList<Integer> al = new ArrayList<>();
ArrayList<Integer> ab = new ArrayList<>();
get(al);
getNum(al,ab);
System.out.println("本期开奖结果为:");
System.out.println(ab);
}
public static void get(ArrayList<Integer> al){
for(int i = 1;i <= 33;i++){
al.add(i);
}
}
public static void getNum(ArrayList<Integer> al,ArrayList<Integer> ab){
Random r = new Random();
for(int i = 1; i <=7;i++){
int l = r.nextInt(al.size());
int b = al.get(l);
ab.add(b);
al.remove(l);
}
}
}
|