Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (19 sloc) 652 Bytes
namespace Problem1_SortArrayOfNumbers
{
using System;
using System.Linq;
public class SortArrayOfNumbers
{
/// <summary>
/// A program to read an array of numbers from the console, sort them and print them back on the console.
/// </summary>
public static void Main()
{
int[] collectionOfNumbers = Console.ReadLine()
.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
.Select(int.Parse).ToArray();
Array.Sort(collectionOfNumbers);
Console.WriteLine(string.Join(" ", collectionOfNumbers));
}
}
}