Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int[] IniTaula(int n)
- {
- int[] t = new int[n];
- for (int i = 0; i < t.Length; i++)
- {
- t[i] = i + 1;
- }
- return t;
- }
- public static void Desordenar(int[] t, int valor)
- {
- Random number = new Random();
- int random1, random2, aux;
- for (int i = 0; i < valor; i++)
- {
- random1 = number.Next(t.Length);
- random2 = number.Next(t.Length);
- aux = t[random1];
- t[random1] = t[random2];
- t[random2] = aux;
- }
- }
- public static void ExtreureBoles(int[] t)
- {
- for (int i = 0; i < t.Length; i++)
- {
- Console.WriteLine("EXRACCIÓ {0} : BOLA NUM {1}", i + 1, t[i]);
- Console.ReadKey();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement