import java.util.Scanner;
class Test_ShuangSeQiu {
public static void main(String[] args) {
int[] arr = new int[6];
Scanner sc = new Scanner(System.in);
System.out.println("请输入你所选的红球:");
for(int i = 0 ;i<arr.length;i++){
System.out.print("第"+(i+1)+"个红球:");
arr[i] =sc.nextInt();
int c2= (int)(Math.random()*33)+1;
System.out.println("第"+(i+1)+"个红球是:"+c2);
if(arr[i]==c2){
System.out.println("红球中奖了");
}else{
System.out.println("没关系,下次继续努力");
}
}
System.out.print("请输入你所选的蓝球:");
int c1 = sc.nextInt();
int c3= (int)(Math.random()*16)+1;
System.out.println("蓝球的开奖结果是:"+c3);
System.out.println("兑奖结果:");
if(c1==c3){
System.out.println("恭喜你的蓝球中奖了");
}else{
System.out.println("没关系,下次继续努力");
}
}
}
|
|