package cn.com.bdqn.keke;
import java.util.*;
public class Test12 {
public static void main(String[]args){
int i;
int j;
boolean a=false;
String name1 = "";
String name2 = "";
String jiXu="y";
int miMa1 = 0;
int miMa2 = 0;
int max=9999;
int min=1000;
int cardNumber;
int cardNumber1[] = new int[5];
Scanner input = new Scanner(System.in);
cardNumber = (int)(Math.random()*(max-min))+min;
for(j=0;j<cardNumber1.length;j++){
cardNumber1[j] = (int)(Math.random()*(max-min))+min;
}
do{
System.out.println("*****欢迎进入奖客富翁系统*****");
System.out.println(" 1,注册");
System.out.println(" 2,登陆");
System.out.println(" 3,抽奖");
System.out.println("**************************");
System.out.print("请选择菜单: ");
i = input.nextInt();
if(i==1){
System.out.println("【奖客富翁系统】注册");
System.out.println("请填写个人注册的信息: ");
System.out.print("用户名:");
name1 = input.next();
System.out.print("密码(请输入六位整数): ");
miMa1 = input.nextInt();
System.out.println("注册成功、请你记住你的信息");
System.out.println("用户名"+"\t"+"密码"+"\t"+"会员卡号");
System.out.println(name1+"\t"+miMa1+"\t"+cardNumber);
System.out.print("继续吗?");
jiXu = input.next();
System.out.println();
}else if(i==2){
System.out.println("【奖客富翁系统】登陆");
System.out.print("请输入用户名:");
name2 = input.next();
System.out.print("请输入密码(六位整数): ‘");
miMa2 = input.nextInt();
if(name1.equals(name2) && miMa1 == miMa2){
System.out.println("欢迎你:"+name2);
}else{
System.out.println("对不起!您还没有注册或用户名和密码不正确!");
}
System.out.print("继续吗?");
jiXu = input.next();
System.out.println();
}else if(i==3){
System.out.println("【奖客富翁系统】抽奖");
System.out.print("请输入您的卡号:");
int kaHao = input.nextInt();
System.out.print("本日的幸运数字为:");
for(j=0;j<cardNumber1.length;j++){
System.out.print(cardNumber1[j]+" ");
}
for(j=0;j<cardNumber1.length;j++){
a=false;
if(kaHao==cardNumber1[i]){
a=true;
break;
}
}
if(a==true){
System.out.println("恭喜您中奖了");
}else{
System.out.println("\n\n抱歉!您不是本日的幸运会员");
}
System.out.print("继续吗?");
jiXu = input.next();
System.out.println();
}
}while("y".equals(jiXu));
System.out.println("系统退出,谢谢您的使用");
}
}