#代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
bool huida = false;
try
{
do
{
Console.WriteLine("*****欢迎进入奖客富翁系统*****");
Console.WriteLine("1注册");
Console.WriteLine("2登录");
Console.WriteLine("3抽奖");
Console.WriteLine("******************************");
Console.WriteLine("请选择菜单:");
huida = false;
int num = Convert.ToInt32(Console.ReadLine());
switch (num)
{
case 1:
Console.WriteLine("[讲课富翁系统>注册]");
Console.WriteLine("请填写个人注册信息:");
Console.WriteLine("用户名:");
string a=Console.ReadLine();
Console.WriteLine("密码:");
string b=Console.ReadLine();
System.Random Random= new System.Random();
int result = Random.Next(1000, 9999);
Console.WriteLine("注册成功,请记好您的会员卡号");
Console.WriteLine("用户名\t密码\t会员卡号");
Console.WriteLine("{0}\t{1}\t{2}", a, b, result);
break;
case 2:
Console.WriteLine("[讲课富翁系统>登录]");
break;
case 3:
Console.WriteLine("[讲课富翁系统>抽奖]");
break;
default:
Console.WriteLine("输入有误,程序结束");
continue;
}
Console.WriteLine("继续吗(y/n)");
string huida0 = Console.ReadLine();
if (huida0 == "y")
{
huida = true;
}
else
{
Console.WriteLine("您选择退出,程序结束.");
continue;
}
} while (huida == true);
}
catch
{
Console.WriteLine("您输入有误");
}
Console.ReadKey();
}
}
}
#效果
网友评论