2024-11-23 09:51:20 +03:00
|
|
|
|
namespace ConsoleApp1
|
|
|
|
|
{
|
|
|
|
|
internal class Program
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
static void Main(string[] args)
|
|
|
|
|
{
|
|
|
|
|
Random random = new Random();
|
|
|
|
|
int value = random.Next(1, 10);
|
|
|
|
|
int user = Convert.ToInt32(Console.ReadLine());
|
|
|
|
|
int count = 1;
|
|
|
|
|
while (user != value) {
|
|
|
|
|
count++;
|
|
|
|
|
if (count == 6) {
|
|
|
|
|
Console.WriteLine("Вы не угадали. У вас закончились попытки");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (user > value)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("Число меньше");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("Число больше");
|
|
|
|
|
}
|
|
|
|
|
user = Convert.ToInt32(Console.ReadLine());
|
|
|
|
|
}
|
2024-11-23 09:51:59 +03:00
|
|
|
|
if (count < 6)async\asqws
|
2024-11-23 09:51:20 +03:00
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("Вы угадали за " + count.ToString() + " попыток");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|