using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace eluosi
{
class Program
{
static void Main(string[] args)
{
new Program().play();
}
void play()
{
Random r = new Random();
int j = r.Next(1, 10);
int i;
int n=1;
Console.Write("猜猜随机数是多少(1~10):");
do
{
i = int.Parse(Console.ReadLine());
if (i == j)
{
Console.Write("恭喜你在第{0}次猜对了", n);
}
else
{
if (i < j)
{
Console.Write("第{0}次,小了", n);
}
else
{
Console.Write("第{0}次,大了", n);
}
}
n++;
} while (i != j);
Console.ReadLine();
}
}
}