davidka007
2012.12.13
|
|
0 0
921
|
using System; using System.Collections.Generic; using System.Linq; using System.Text;
namespace ConsoleApplication1 { class Program { static void Main(string[] args) { int min = 0, max = 0; int i, t = 0, a; Random vsz = new Random(); a = Convert.ToInt16(vsz.Next(10)); if (a % 2 == 0) { Console.WriteLine("{0} paros:", a); } else { Console.WriteLine("{0} paratlan:", a); }
for (i = 0; i < 10; i++) if (a < min) min = a; for (i = 0; i < 10; i++) if (a > max) max = a; double k1 = (min + max) / 2, k2 = max;
Console.WriteLine("Kerem adja meg a tippet: "); while (t != a) { t = Convert.ToInt16(Console.ReadLine()); if (t < a) Console.WriteLine("A gondolt szám kisebb, mint a tipp. "); if (t > a) Console.WriteLine("A gondolt szám nagyobb, mint a tipp."); if (t == a) Console.WriteLine("Erre gondoltam"); }
Console.ReadKey(); } } }
na szval ez az én változatom csak ugy kellene hogy ne a gép adja és én találjam ki hanem ugyan ez megfordítva.Erre nem tudok rájönni...
|
Előzmény: DJG (919)
|
|