Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Example
- {
- public static void Main()
- {
- int[] array = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
- Shuffle(array);
- Console.ReadKey();
- }
- static void Shuffle(int[] array)
- {
- Random random = new Random();
- for (int i = 0; i < array.Length; i++)
- {
- int j = random.Next(array.Length);
- array[i] = j;
- }
- for (int i = 0; i < array.Length; i++)
- {
- Console.WriteLine(array[i]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement