完成以下要求:
string u = "y";
Console.WriteLine("*******欢迎进入奖客富翁系统*********");
Console.WriteLine("1.注册");
Console.WriteLine("2.登录");
Console.WriteLine("3.抽奖");
Console.WriteLine("*******************************");
while(u=="y")
{
Console.WriteLine("请选择菜单:");
int i = Convert.ToInt32(Console.ReadLine());
switch (i)
{
case 1:
Console.WriteLine("注册");
Console.WriteLine("写");
Console.WriteLine("用户名:");
string y = Console.ReadLine();
Console.WriteLine("密码:");
string t = Console.ReadLine();
Console.WriteLine("注册成功");
int max = 9999;
int min = 1000;
Random rd = new Random();
int q=rd.Next(min, max);
Console.WriteLine("用户名 密码 卡号");
Console.WriteLine(y + " " + t + " " + q);
break;
case 2:
Console.WriteLine("登录");
break;
case 3:
Console.WriteLine("抽奖");
break;
}
Console.WriteLine("是否继续?(y/n)");
u = Console.ReadLine();
if (u!="y")
{
Console.WriteLine("关闭程序");
}
}
Console.ReadKey();
网友评论