import java.util.Random;
public class Control {
private int num = 4;
private String str = "";
public static void main(String[] args) {
Control c = new Control();
isWin(c.productRandom());
}
public String productRandom(){
Random d = new Random();
for(int i=0;i<num;i++){
String s = d.nextInt(2)+"";
str = randomSelection(s)+str;
}
System.out.println("您抽到的数字是:"+str);
return str;
}
public static String randomSelection(String str){
if(str.equals("1")){
return "★";
}else{
return "☆";
}
}
public static void isWin(String str){
if(str.equals("★★★★")){
System.out.println("恭喜您!中了一等奖!!!");
}else if(str.equals("★★★☆")){
System.out.println("恭喜您,中了二等奖!!!");
}else if(str.equals("★★☆☆")){
System.out.println("恭喜您,中了三等奖!!!");
}else{
System.out.println("不要灰心,希望下次中奖!!!");
}
}
}