美文网首页
第18节课第2个练习

第18节课第2个练习

作者: Deku啊 | 来源:发表于2018-12-27 08:52 被阅读0次

#作业目标:

##编码:

for (int i = 1; i >= 1; i++)

            {

                Console.WriteLine("*****欢迎进入奖客富翁系统*****");

                Console.WriteLine(@"      1.注册

      2.登录

      3抽奖");

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

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

                //选择菜单编号

                string str_num = Console.ReadLine();

                try

                {

                    int num = Convert.ToInt32(str_num);

                    switch (num)

                    {

                        case 1:

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

                            break;

                        case 2:

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

                            break;

                        case 3:

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

                            break;

                        default:

                            Console.WriteLine("您输入有误!");

                            break;

                    }

                }

                catch { Console.WriteLine("您输入有误!"); }

                //询问是否继续

                Console.Write("继续吗? (Y/N):");

                string a = Console.ReadLine();

                //判断

                if (a != "Y")

                { Console.WriteLine("系统退出!谢谢使用!");

                  break;

                }

            }

            Console.ReadKey();

###实际效果L:

相关文章

网友评论

      本文标题:第18节课第2个练习

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