美文网首页
2018-10-31

2018-10-31

作者: be1058558528 | 来源:发表于2018-10-31 20:47 被阅读0次

作业2:

让用户输入用户名和密码,如果用户名为admin,密码为mypass,则提示登录成功.

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

string user = Console.ReadLine();

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

string key = Console.ReadLine();

bool a = user =="admin"  && key == "mypass";

if (a)

{

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

}

Console.ReadKey();

相关文章

网友评论

      本文标题:2018-10-31

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