class Program
{
static void Main(string[] args)
{
while (true)
{
Random rd = new Random();
int result = rd.Next(0, 100);//结果
Console.WriteLine("请请输入一个整数(范围为1~100)");
while (true)
{
int input = int.Parse(Console.ReadLine());
if (input == result)
{
Console.WriteLine("恭喜你,猜对了!");
break;
}
else if (input < result)
Console.WriteLine("猜小了!");
else
Console.WriteLine("猜大了!");
}
Console.WriteLine("是否继续,是请输入Y,否请输入N:");
char C = char.Parse(Console.ReadLine());
if (C == 'N')
break;
}
}
}