You are on page 1of 1

using System;

namespace Batle3
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Poproszę odgadać liczbę");
Random r = new Random();
int c = r.Next(0, 100);

int a = int.Parse(Console.ReadLine());
int n = 0;
while (!(a == c))
{
n++;
if (a < c)
{
Console.WriteLine("Szukana wartość jest większa");
}
if (a > c)
{
Console.WriteLine("Szukana wartość jest mniejsza");
}
a = int.Parse(Console.ReadLine());
}
Console.WriteLine("Dobra robota, liczba {0} jest prawdziła, udało się
odgadać z {1} proby", a, n);

}
}
}

You might also like