Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using static System.Runtime.InteropServices.JavaScript.JSType;
- internal class Program
- {
- static void Main(string[] args)
- {
- Random random = new Random();
- int[] numbers = new int[10];
- for (int i = 0; i < numbers.Length; i++)
- {
- numbers[i] = random.Next(1, 10);
- }
- Shuffle(numbers);
- for (int i = 0; i < numbers.Length; i++)
- {
- Console.Write(numbers[i]);
- }
- }
- static void Shuffle(int[] array)
- {
- Random random = new Random();
- for (int i = 0; i < array.Length; i++)
- {
- int tempIndex = random.Next(array.Length);
- int tempArray = array[tempIndex];
- array[tempIndex] = array[i];
- array[i] = tempArray;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement