fork(1) download
  1. using System;
  2. using System.Linq;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. int[] a = new int[] {1, 2, 1, 3, 1, 4, 1, 5, 1, 6};
  9. var b = from x in a group x by x into t select t.Key;
  10. var c = a.Distinct();
  11. Console.WriteLine(String.Join(" ", b));
  12. Console.WriteLine(String.Join(" ", c));
  13. }
  14. }
Success #stdin #stdout 0.06s 24464KB
stdin
Standard input is empty
stdout
1 2 3 4 5 6
1 2 3 4 5 6