package 综合练习;
import java.util.Random;
public class Test3 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Random r1= new Random();
int num1 = r1.nextInt(32);
int num2 = r1.nextInt(16);
if(num1==6 && num2==1)
{
System.out.println("一等奖");
}
else if(num1==6 && num2==0)
{
System.out.println("二等奖");
}
else if(num1==5 && num2==1)
{
System.out.println("三等奖");
}
else if((num1==5&&num2==0)||(num1==4&&num2==1))
{
System.out.println("四等奖");
}
else if((num1==4&&num2==0)||(num1==3&&num2==1))
{
System.out.println("五等奖");
}
else if((num1==2&&num2==1)||(num1==1&&num2==1)||(num1==0&&num2==1))
{
System.out.println("六等奖");
}
else
{
System.out.println("未中奖");
}
}
}
综合练习
最新推荐文章于 2022-12-08 10:54:33 发布