подобие на функцията OrderBy(x => x)
using System;
using System.Collections.Generic;
using System.Linq;
namespace Count_Real_Numbers
{
class Program
{
static void Main(string[] args)
{
int[] numbers = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
int[] num = new int[numbers.Length];
for (int i = 0; i < num.Length; i++)
{
int min = int.MaxValue;
for (int j = 0; j < numbers.Length; j++)
{
if (numbers[j] < min)
{
min = numbers[j];
}
}
num[i] = min;
int[] arr = new int[numbers.Length - 1];
byte count = 0;
for (int j = 0; j < numbers.Length - 1; j++)
{
if (numbers[j] != min)
{
arr[j] = numbers[j];
}
else
{
count = 1;
}
if(count == 1)
{
arr[j] = numbers[j + 1];
}
}
numbers = arr.ToArray();
}
numbers = num.ToArray();
Console.WriteLine(string.Join(" ",numbers));
}
}
}