第八节课作业第二题
作者:
你不要难过 | 来源:发表于
2018-11-14 16:28 被阅读0次
作业要求: 要求用户输入用户名和密码,只要不是admin、888888就一直提示用户名或密码错误,请重新输入.
作业代码:
string name = "";
string pwd = "";
do
{
Console.WriteLine("请输入用户名");
name = Console.ReadLine();
Console.WriteLine("请输入密码");
pwd = Console.ReadLine();
if (name != "admin" || pwd != "88888888")
{
Console.WriteLine("用户名或密码错误");
}
}
while (name != "admin" || pwd != "88888888");
Console.WriteLine("登录成功");
Console.ReadKey();
作业效果:
1.png

2.png
本文标题:第八节课作业第二题
本文链接:https://www.haomeiwen.com/subject/bvrjfqtx.html
网友评论