2018-12-27

bool b = true; while (b) { Console.WriteLine("*****欢迎进入奖客富翁系统"); Console.WriteLine(" 1.注册 "); Console.WriteLine(" 2.登录 "); Console.WriteLine(" 3.抽奖 "); Console.WriteLine("****************************"); Console.Write("请选择菜单"); int a = Convert.ToInt32(Console.ReadLine()); switch (a) { case 1: Console.WriteLine("奖客富翁系统>注册"); break; case 2: Console.WriteLine("奖客富翁系统>登录"); break; case 3: Console.WriteLine("奖客富翁系统>抽奖"); break; default: Console.WriteLine("你输入的格式有误"); break; } Console.WriteLine("你是否继续(yes/no)"); string c = Console.ReadLine(); if (c == "yes") { b = true; } else if (c == "no") { b = false; } else { Console.WriteLine("程序结束,系统退出"); Console.ReadKey(); }

 

 

bool b = true; while (b) { Console.WriteLine("*****欢迎进入奖客富翁系统"); Console.WriteLine(" 1.注册 "); Console.WriteLine(" 2.登录 "); Console.WriteLine(" 3.抽奖 "); Console.WriteLine("****************************"); Console.Write("请选择菜单"); int a = Convert.ToInt32(Console.ReadLine()); switch (a) { case 1: Console.WriteLine("奖客富翁系统>注册"); break; case 2: Console.WriteLine("奖客富翁系统>登录"); break; case 3: Console.WriteLine("奖客富翁系统>抽奖"); break; default: Console.WriteLine("你输入的格式有误,程序退出"); break; } Console.WriteLine("请填写个人注册信息"); Console.WriteLine("用户名: "); string name = Console.ReadLine(); Console.WriteLine("密码: "); int h = Convert.ToInt32(Console.ReadLine()); int max = 99999; int min = 1000; Random rd = new Random(); ; Console.WriteLine("注册成功,请记好你的会员卡号"); Console.WriteLine("用户名\t密码\t会员卡号"); Console.WriteLine("{0}\t{1}\t{2}", name, h, rd.Next(min, max)); Console.WriteLine("继续吗?(yes/no)"); string d = Console.ReadLine(); if (d == "yes") { b = true; } if (d == "no") { Console.WriteLine("系统退出,谢谢使用"); Console.ReadKey(); } }

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • #代码 using System; using System.Collections.Generic; using...
    柏建春阅读 133评论 0 0
  • #代码 bool j=false; try { do { ...
    追魂_409e阅读 211评论 0 0
  • #代码 using System; using System.Collections.Generic; using...
    柏建春阅读 188评论 0 0
  • try { Console.WriteLine("*****欢迎进入奖客富翁系统*****"); Console ...
    zealot_bbc8阅读 176评论 0 0
  • #注册 using System; using System.Collections.Generic; using...
    柏建春阅读 181评论 0 0