Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- Random rnd = new Random();
- int[] tomb = new int[5];
- int i = 0;
- while(i < 5)
- {
- int szam = rnd.Next(10, 16);
- Boolean bennevan = false;
- foreach (int elem in tomb)
- {
- if (elem == szam)
- {
- bennevan = true;
- }
- }
- if (bennevan != true)
- {
- tomb[i] = szam;
- Console.WriteLine(szam);
- i++;
- }
- }
- Console.ReadKey();
- }
- }
- }
Add Comment
Please, Sign In to add comment