#作业目标:提示用户输入密码,如果密码是“88888”则提示正确,否则提示错误,程序结束。
##代码:

Console.WriteLine("请输入你的密码!");
string pwd = Console.ReadLine();
if (pwd == "88888")
{ Console.WriteLine("密码正确,登录成功!"); }
else {Console.WriteLine("密码输入错误!");}
Console.WriteLine("程序运行到此结束!");
Console.ReadKey();
###实际效果:


网友评论