美文网首页
第四节课作业第四题

第四节课作业第四题

作者: 你不要难过 | 来源:发表于2018-10-31 20:52 被阅读0次

#作业代码:

Console.WriteLine("请输入用户名");

            string str_name = Console.ReadLine();         

            if ( str_name != "admin")

            {

                Console.WriteLine("用户名错误请关闭重试");

            }

            else

            {

                Console.WriteLine("请输入密码");

                string mima = Console.ReadLine();

                if (mima == "mypass")

                {

                    Console.WriteLine("登录成功");

                }

                else

                {

                    Console.WriteLine("密码错误登录失败请重试");

                }

            }

            Console.ReadKey();

}

}

}

#作业效果:

相关文章

网友评论

      本文标题:第四节课作业第四题

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