第五课作业
作者:
是小凌哟 | 来源:发表于
2018-11-04 21:12 被阅读0次
让用户输入用户名和密码,如果用户名为admin,密码为mypass,则提示登录成功.
![](https://img.haomeiwen.com/i14500223/bc1c2bb31011d4fc.jpg)
第五课作业Console.WriteLine("请输入年龄"); int year = Convert.ToInt32(Console.ReadLine()); if (year >= 18) { Console.WriteLine("可以查看"); Console.ReadKey(); } else if (year < 10) { Console.WriteLine("不允许查看"); Console.ReadKey(); } if (year >= 10 && year < 18) { Console.WriteLine("是否继续查看(yes、no)"); string a = Console.ReadLine(); if (a == "yes") { Console.WriteLine("可以查看"); Console.ReadKey(); } else { Console.WriteLine("退出,你放弃查看"); Console.ReadKey(); }
本文标题:第五课作业
本文链接:https://www.haomeiwen.com/subject/kmmdxqtx.html
网友评论