using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    internal class Program
    {
        public static void TombKiir(int[] tomb)
        {
            foreach (int i in tomb) {
                Console.WriteLine($"{i}");
            }
        }

        public static int[] Beszurorendez(int[] bemenet)
        {
            int[] tomb = new int[bemenet.Length];
            Array.Copy(bemenet, tomb, bemenet.Length);

            for (int i = 1; i < tomb.Length; i++)
            {
                int j = i - 1;
                var temp = tomb[i];
                while ((j >= 0) && tomb[j] > temp)
                {
                    tomb[j + 1] = tomb[j];
                    j--;
                }
                tomb[j+1] = temp;
            }

            return tomb;
        }
        static void Main(string[] args)
        {
            int[] tomb = new int[] { 5, 6, 7, 8, 1 , 2 ,3 };
            TombKiir(Beszurorendez(tomb));
            

        }
    }
}
