using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Test_011
{
class Program
{
static void Main(string[] args)
{
Random random = new Random();
int number1 = random.Next(1024);
Console.WriteLine("随机生成数: " + number1);
Console.Write("输入一个整数(0-1024): ");
int count ;
for (count = 0; count < 10; count++)
{
int number2 = int.Parse(Console.ReadLine());
if (number1 > number2)
{
Console.WriteLine("猜小了,重新输入: ");
}
else if (number1 == number2)
{
Console.WriteLine("你真聪明");
break;
}
else
{
Console.WriteLine("猜大了,重新输入: ");
}
}
if (count == 10)
Console.WriteLine("失败,猜数结束");
Console.Read();
}
}
}