/**
* 需求:机选一注双色球
*/
public static void main(String[] args) {
red();
blue();
}
public static void blue() {
HashSet<Integer> hs = new HashSet<>();
Random r = new Random();
while (hs.size() < 1) {
int arr = r.nextInt(16) + 1;
hs.add(arr);
}
for (Integer it : hs) {
System.out.print(it + "]");
}
}
public static void red() {
System.out.print("[");
TreeSet<Integer> ts = new TreeSet<>(new Comparator<Integer>() {
@Override
public int compare(Integer o1, Integer o2) {
int num = o1.compareTo(o2);
return num == 0 ? 0 : num;
}
});
Random r = new Random();
while (ts.size() < 6) {
int arr = r.nextInt(33) + 1;
ts.add(arr);
}
for (Integer it : ts) {
System.out.print(it + ",");
}
}