Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace Articulo.CSharp.MetodosExtension
- {
- public sealed class MetodoExtensionOrderBy
- {
- public static void Main()
- {
- // Declaración e inicialización de un arreglo de enteros:
- int[] enteros = {29, 13, 2, 5, 7, 37, 71};
- // Ordenamiento de los elementos:
- var arregloOrdenado = enteros.OrderBy ( num => num);
- Console.WriteLine ();
- foreach (var num in arregloOrdenado)
- {
- Console.Write ("{0}\t", num.ToString());
- }
- Console.WriteLine (Environment.NewLine);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement