大乐透奖池都快70亿了,主任什么时候被抓起来??
很无聊,然后写了这段不知所以的大乐透摇奖打印程序
import java.util.*;
/**
* @author
* @date 2018/11/29 13:49
*/
public class daletou{
public static void main(String args[]) {
List listA = new ArrayList<Integer>();
for (int i=1;i<36;i++){
listA.add(i);
}
Collections.shuffle(listA);
List listB = new ArrayList<Integer>();
for (int i=1;i<13;i++){
listB.add(i);
}
Collections.shuffle(listB);
TreeSet ts = new TreeSet();
TreeSet ts2 = new TreeSet();
System.out.print("下期大乐透的随机开奖号码为:上半区 ");
for (int j = 1; j < 6; j++) {
ts.add(listA.get(j));
}
Iterator<Integer> i = ts.iterator();
while(i.hasNext()){
System.out.print(i.next()+" ");
}
System.out.print("下半区"+" ");
for (int k = 1; k < 3 ; k++) {
ts2.add(listB.get(k));
}
Iterator<Integer> j = ts2.iterator();
while(j.hasNext()){
System.out.print(j.next()+" ");
}
}
}