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

namespace FctCuNrVarDeParam
{
    class Program
    {
       
        static void OrdoneazaC(params int [] sir)
        {
            Boolean schimb = true;
            do
            {
                schimb = false;
                for(int i = 0; i<sir.Length-1; i++)
                    if (sir[i] > sir[i + 1])
                    {
                        int temp = sir[i];
                        sir[i] = sir[i + 1];
                        sir[i + 1] = temp;
                        schimb = true;
                    }

            }
            while(schimb == false);
        }

        static void Main(string[] args)
        {
            int[] nr = new int[] { 3, 1, 7, 8, 2, 14, 6};
            Console.WriteLine("Sirul initial: ");
            foreach(int x in nr)
            {
                Console.Write(x + " ");
            }
            Console.WriteLine();
            Console.WriteLine("Ordonat crescator: ");
            OrdoneazaC(nr);
            foreach (int x in nr)
            {
                Console.Write(x + " ");
            }
            Console.WriteLine();
        }
    }
}
