public static void main(String[] args) {
int count=0;
while (!flags()){
count++;
System.out.println(count);
}
}
public static int[] gets(){
Map<Integer,Integer> flag=new HashMap<Integer,Integer>();
Random r=new Random();
while (flag.size()!=6){
flag.put(r.nextInt(32)+1,r.nextInt(32)+1);
}
int blue=r.nextInt(15)+1;
int[] red=new int[6];
int[] finals=new int[7];
int count=0;
for (Integer t:flag.keySet()) {
red[count]=t;
count++;
}
Arrays.sort(red);
finals=Arrays.copyOf(red,finals.length);
finals[6]=blue;
return finals;
}

public static boolean flags(){
int[] flag=gets();
int[] my=gets();
boolean flags=true;
for (int i = 0; i <flag.length ; i++) {
if(flag[i]!=my[i]){
flags=false;
break;
}
}
if (flags){
for (int m:my) {
System.out.print(m+" ");
}
System.out.println("恭喜获得500万!");
}
return flags;
}
扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄