美文网首页
第十六课

第十六课

作者: 怡壹 | 来源:发表于2021-09-23 18:05 被阅读0次

一、
int i= 0;
string password = "";
Console.WriteLine("*****欢迎进入奖客富翁系统*****");
Console.WriteLine(" 1.注册");
Console.WriteLine(" 2.登录");
Console.WriteLine(" 3.抽奖");
Console.WriteLine("******************************");
Console.WriteLine("请选择菜单:");
i = Convert.ToInt32(Console.ReadLine());
switch (i)
{
case 1:
Console.WriteLine("[奖客富翁系统>注册]");
break;
case 2:
Console.WriteLine("[奖客富翁系统>登录]");
break;
case 3:
Console.WriteLine("[奖客富翁系统>抽奖]");
break;
}

        Console.ReadKey();

二、
int max = 99999;
int min = 1000;
Random rd = new Random();
rd.Next(min, max);
int a = 0;
int id =0;
string user = "";
string key = "";
string b = "";
Console.WriteLine("*****欢迎进入奖客富翁系统*****");
Console.WriteLine(" 1.注册");
Console.WriteLine(" 2.登录");
Console.WriteLine(" 3.抽奖");
Console.WriteLine("******************************");
Console.WriteLine("请选择菜单:");
a = Convert.ToInt32(Console.ReadLine());
switch (a)
{
case 1:
Console.WriteLine("[奖客富翁系统>注册]");
Console.WriteLine("请填写用户注册信息:");
Console.WriteLine("用户名:");
user = Console.ReadLine();
Console.WriteLine("密码:");
key = Console.ReadLine();
Console.WriteLine("注册成功,请记好你的会员卡号");
Console.WriteLine("用户名\t\t密码\t\t会员卡号");
Console.WriteLine("{0}\t\t{1}\t\t{2}", user, key, rd.Next(min, max));
Console.WriteLine("继续吗?(y/n)");
b = Console.ReadLine();
break;
case 2:
Console.WriteLine("[奖客富翁系统>登录]");
Console.WriteLine("请输入用户名:");
user = "admin";
key ="123456";
string yonghu =Console.ReadLine();
Console.WriteLine("请输入密码:");
string mima =Console.ReadLine();
for (int i = 0; i < 4; i++)
{
if (user == yonghu & key == mima)
{
Console.WriteLine("欢迎您:{0}", yonghu);
break;
}
else
{
Console.WriteLine("你还剩{0}次机会", 3 - i);
continue;
}
}
break;
case 3:
Console.WriteLine("[奖客富翁系统>抽奖]");
Console.WriteLine("请输入你的卡号");
id =Convert.ToInt32(Console.ReadLine());
Console.WriteLine("今日的幸运数字为:");
for(int i =0;i<4;i++)
{
Console.WriteLine(rd.Next(min, max));
}
if (rd.Next(min, max) == id)
{
Console.WriteLine("恭喜!你是本日的幸运会员!");
}
else
{
Console.WriteLine("抱歉!您不是本日的幸运会员!");
}
break;
}
Console.WriteLine("继续吗?(y/n)");
b = Console.ReadLine(); switch (b)
{
case "n":
Console.WriteLine("系统退出,谢谢使用");
break;
case "y":
Console.WriteLine("");
break;
}
Console.ReadKey();

相关文章

  • 身体清洁第十六课——简单忠诚

    身体清洁第十六课——简单忠诚 林海峰作品

  • 幸福课16-23

    **第十六课:享受过程 ** How do we overcome perfectionism and becom...

  • 世界上最神奇的24堂课第十六课

    今天我们来聊聊,世界上最神奇的24堂课第十六课 第十六课 心灵印记和精神图景 周期性是生命的第一属性,但凡有生命的...

  • 一周总结

    这一周,我们在语文上先学了,第十四课,第十五课,第十六课,第十七课,第十八课。我们在数学上新学了,方程和解...

  • 2017噗啦秋季美学课程16(4-6)

    第十六课 城堡 噗啦美学指导师:麦麦 课前材料准备: 画纸、黑卡、丙烯、油画棒 教...

  • 第十六课

    大家都为这场party穿上了盛装 people dressed up for the party 大家 盛装 we...

  • 第十六课

    上一课我已经提到过NPV和IRR的概念及使用区别,在本节中,我将再补充一个WACC资本成本率的概念。资本成本率中,...

  • 第十六课 ШЕСТНАДЦАТЫЙ УРОК

    单词 Слова: шестнадцать(数)十六 шестнадцатый(数)第十六 поход(名、阳)(...

  • 第十六课

    痛苦的日子久了就会是麻木了,甚至身边的人也麻木,但这并不代表痛苦就不在了。反而会更加害怕和孤独,即使有人营救,自己...

  • 第十六课

    一、int i= 0;string password = "";Console.WriteLine("*****欢...

网友评论

      本文标题:第十六课

      本文链接:https://www.haomeiwen.com/subject/smwrlqtx.html