Advertisement
SomeBody_Aplle

Untitled

Mar 7th, 2021
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 KB | None | 0 0
  1. for (int i = 0; i < array.Length; i++)
  2.             {
  3.                 array[i] = rand.Next(0, 20);
  4.                 Console.Write(array[i] + " ");
  5.             }
  6.             System.Collections.ArrayList unique = new System.Collections.ArrayList();
  7.            
  8.             for (int i = 0; i < array.Length; i++)
  9.                 if (unique.IndexOf(array[i]) == -1)
  10.                     unique.Add(array[i]);
  11.  
  12.             Console.WriteLine();
  13.             for (int i = 0; i < unique.Count; i++)
  14.                 Console.Write(unique[i] + " ");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement