using System;
using System.Collections.Generic;
using System.Linq;
public class PruebaDistinct
{
public static void Main()
{
List<int> edades = new List<int> { 21, 46, 46, 55, 17, 21, 55, 55};
IEnumerable<int> edadesDistintas = edades.Distinct();
Console.WriteLine("\nEdades diferentes:");
foreach (int edad in edadesDistintas)
{
Console.WriteLine("\t{0}", edad.ToString());
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYzsKdXNpbmcgU3lzdGVtLkxpbnE7CgpwdWJsaWMgY2xhc3MgUHJ1ZWJhRGlzdGluY3QKewoJcHVibGljIHN0YXRpYyB2b2lkIE1haW4oKQoJewoJCUxpc3Q8aW50PiBlZGFkZXMgPSBuZXcgTGlzdDxpbnQ+IHsgMjEsIDQ2LCA0NiwgNTUsIDE3LCAyMSwgNTUsIDU1fTsKCQkKCQlJRW51bWVyYWJsZTxpbnQ+IGVkYWRlc0Rpc3RpbnRhcyA9IGVkYWRlcy5EaXN0aW5jdCgpOwoJCQoJCUNvbnNvbGUuV3JpdGVMaW5lKCJcbkVkYWRlcyBkaWZlcmVudGVzOiIpOwoJCWZvcmVhY2ggKGludCBlZGFkIGluIGVkYWRlc0Rpc3RpbnRhcykKCQl7CgkJCUNvbnNvbGUuV3JpdGVMaW5lKCJcdHswfSIsIGVkYWQuVG9TdHJpbmcoKSk7CgkJfQoJfQp9