class Program
{
static void Main(string[] args)
{
Console.WriteLine("你同意吗?(输入y/n)");
string result = ReadInt();
if (result == "y")
{
Console.WriteLine("请继续观看");
}
else
{
Console.WriteLine("谢谢使用,退出程序");
}
Console.ReadKey();
}
public static string ReadInt()
{
string s = "";
s = Console.ReadLine();
if (s == "y" || s == "n")
{
return s;
}
else
{
Console.WriteLine("您的输入有误,请重新输入!");
}
}
} |