using System;
using System.Collections.Generic;
using System.Linq;
namespace NilPointer
{
class Program
{
static void Main(string[] args)
{
var numbers = new List<int> {
50, 2, -7, 11,-9, 26
};
Console.WriteLine("ASC");
numbers.OrderBy(number => number).ToList().ForEach(number =>
{
Console.Write(number + " ");
});
Console.WriteLine("\nDESC");
numbers.OrderByDescending(number => number).ToList().ForEach(number =>
{
Console.Write(number + " ");
});
Console.ReadLine();
}
}
}
ASC
-9 -7 2 11 26 50
DESC
50 26 11 2 -7 -9