1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
package
幸运抽奖;
import
java.util.Scanner;
public
class
A03 {
public
static
void
main(String[] args) {
// TODO Auto-generated method stub
Scanner input =
new
Scanner(System.in);
String A =
"y"
;
do
{
System.out.println(
"*************购 物 管 理 系 统************"
);
System.out.println(
"\t\t1.注册"
);
System.out.println(
"\t\t2.登录"
);
System.out.println(
"\t\t3.抽奖"
);
System.out.println(
"*****************************************"
);
System.out.println(
"\n请选择菜单:"
);
int
choice = input.nextInt();
int
random = (
int
) (Math.random() *
4000
);
switch
(choice) {
case
1
:
System.out.println(
"购物管理系统>注册"
);
System.out.println(
"请填写个人注册信息:"
);
System.out.print(
"请输入用户名:"
);
String name = input.next();
System.out.print(
"请输入密码:"
);
String pwd = input.next();
System.out.println(
"\n注册成功!请您记住您的会员卡号:"
);
System.out.println(
"用户名\t密码\t会员卡号"
);
System.out.println(name +
"\t"
+ pwd +
"\t"
+ random);
break
;
}
System.out.println(
"是否继续(y / n ):"
);
A = input.next();
}
while
(A.equals(
"y"
));
System.out.println(
"谢谢使用"
);
}
}
|
本文转自 Y幕徐 51CTO博客,原文链接:http://blog.51cto.com/765133133/1421196