using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication19
{
class Program
{
static void Main(string[] args)
{
string name = "";
string pwd = "";
//循环体:输入用户名和密码 判断
//循环条件:输入错误
do
{
Console.WriteLine("请输入用户名");
name = Console.ReadLine();
Console.WriteLine("请输入密码");
pwd = Console.ReadLine();
if (name != "admin" || pwd != "888888")
{
Console.WriteLine("用户名或密码错误");
}
}
while (name != "admin" ||pwd != "888888");
Console.WriteLine("登录成功");
Console.ReadKey();
}
}
}
image.png
网友评论