mirror of
https://github.com/theoludwig/programming-challenges.git
synced 2024-12-08 00:45:29 +01:00
feat(solutions): add sorting-algorithms/cs/function
This commit is contained in:
parent
6638ed59ae
commit
b824619dd9
@ -0,0 +1,3 @@
|
|||||||
|
# sorting-algorithms/cs/function
|
||||||
|
|
||||||
|
Created by [@Divlo](https://github.com/Divlo) on 11 September 2021.
|
@ -0,0 +1,29 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Solution
|
||||||
|
{
|
||||||
|
class Program
|
||||||
|
{
|
||||||
|
static void Main()
|
||||||
|
{
|
||||||
|
string line = Console.ReadLine();
|
||||||
|
List<int> numbers = new List<int>();
|
||||||
|
while ((line = Console.ReadLine()) != null)
|
||||||
|
{
|
||||||
|
numbers.Add(int.Parse(line));
|
||||||
|
}
|
||||||
|
int[] result = NativeSort(numbers.ToArray());
|
||||||
|
foreach (int number in result)
|
||||||
|
{
|
||||||
|
Console.WriteLine(number);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int[] NativeSort(int[] array)
|
||||||
|
{
|
||||||
|
Array.Sort(array);
|
||||||
|
return array;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user