Console.WriteLine("请输入年龄");
int year = Convert.ToInt32(Console.ReadLine());
if (year >= 18)
{ Console.WriteLine("可以查看"); }
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("请查看"); }
if (a == "no")
{ Console.WriteLine("退出,你放弃查看"); }
Console.ReadKey();