/* * Created by SharpDevelop. * User: Student * Date: 2015-11-24 * Time: 16:34 * * To change this template use Tools | Options | Coding | Edit Standard Headers. */ using System;
namespace zadanie_1_lista_6 { class Program { public static void Main(string[] args) { int a,x,j; Random gen = new Random(); a = gen.Next(0, 50); j=0; do { Console.WriteLine ("liczba ukryta to "+a); Console.WriteLine("Podaj liczbe "); x=int.Parse(Console.ReadLine()); if (a==x) Console.WriteLine("trafiona!! a= "+a); else Console.WriteLine ("strzelaj dalej"); j++; } while (a!=x && j!=5);