Advertisement
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;
- using System.Threading.Tasks;
- namespace Practice
- {
- class Program
- {
- static void Main(string[] args)
- {
- int size;
- size = int.Parse(Console.ReadLine());
- Random rnd = new Random();
- int[] arr = new int[size];
- for (int i = 0; i < arr.Length; i++)
- {
- arr[i] = rnd.Next(0,10);
- for (int b = 0; b < i; b++)
- {
- while (arr[i] == arr[b])
- {
- arr[i] = rnd.Next(0, 10);
- b = 0;
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement