public int[] Generuj(int pocet, int min, int max)
{
this.pocet = pocet;
this.min = min;
this.max = max;
int[] pole = new int[pocet];
Random rand = new Random();
for (int i = 0; i < pocet; i++)
{
pole[i] = rand.Next(min, max+1);
}
return pole;
}
public void ZapisDoSouboru(string path)
{
StreamWriter sw = new StreamWriter(path);
foreach (int i in Generuj(pocet,min,max))
sw.Write("{0} ", i);
sw.Close();
Console.WriteLine("Zápis do souboru hotov.");
}
určitě to jde zapsat lepším způsobem, teprve začínam