第十七节课第三个课上练习

try

            {

                Console.WriteLine("*******欢迎进入抽奖系统*******");

                Console.WriteLine(@"            1.注册

            2.登录

            3.抽奖");

                Console.WriteLine("***************************");

                Console.Write("选择是:");

                string num = Console.ReadLine();

                switch (num)

                {

                    case "1":

                        Console.WriteLine("[富豪系统>注册]");

                        break;

                    case "2":

                        Console.WriteLine("[富豪系统>登录]");

                        break;

                    case "3":

                        Console.WriteLine("[富豪系统>抽奖]");

                        break;

                    default:

                        Console.WriteLine("输入错误");

                        break;

                }

                if (num == "1")

                {

                    Console.WriteLine("填写个人信息");

                    Console.Write("用户名:");

                    string admin = Console.ReadLine();

                    Console.Write("密码:");

                    string password = Console.ReadLine();

                    int max = 9999;

                    int min = 1000;

                    Random rd = new Random();

                    int b = 0;

                    b=rd.Next(min, max);

                    Console.WriteLine();

                    Console.WriteLine("注册成功");

                    Console.WriteLine("用户名\t密码\t卡号");

                    Console.WriteLine("{0}\t{1}\t{2}", admin,password,b);

                }

                else

                {

                    Console.WriteLine("进入注册界面进行注册");

                }


            }

            catch

            {

                Console.WriteLine("输入错误");

            }

            Console.WriteLine("继续吗?[y/n]");

            string a = Console.ReadLine();

            if (a == "y")

            {

                try

                {

                    Console.WriteLine("*******欢迎进入抽奖系统*******");

                    Console.WriteLine(@"            1.注册

            2.登录

            3.抽奖");

                    Console.WriteLine("***************************");

                    Console.Write("选择是:");

                    string num = Console.ReadLine();

                    switch (num)

                    {

                        case "1":

                            Console.WriteLine("[富豪系统>注册,ture]");

                            break;

                        case "2":

                            Console.WriteLine("[富豪系统>登录]");

                            break;

                        case "3":

                            Console.WriteLine("[富豪系统>抽奖]");

                            break;

                        default:

                            Console.WriteLine("输入错误");

                            break;

                    }

                }

                catch

                {

                    Console.WriteLine("输入错误");

                }

            }

            else if (a == "n")

            {

                Console.WriteLine("系统退出");

            }

            else

            {

                Console.WriteLine("输入错误");

            }


            Console.ReadKey();

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

推荐阅读更多精彩内容