#include <stdio.h>
#include <iostream>

using std::cout;
using std::cin;
using std::endl;
using std::string;


void InsertSort(int a[], int n)
{
   int i,j,v;
   for(i=0;i<n;i++)
   {
      v=a[i];
      j=i;

      while((a[j-1]>v)&&(j>0))
      {
         a[j]=a[j-1];
         j--;
      }
      a[j]=v;
   }
}


void main()
{
   int Pole[] = {11, 3, 27, 8, 50, 22, 12};

   cout << "Setridte pole cisel: " <<endl;

   for (int p= 0; p<7;p++)
      cout<<Pole[p]<<" ";
   cout<<endl;

   InsertSort(Pole, 8);

   cout<<"Setridene pole: "<<endl;
   for (int j= 0; j<7;j++)
      cout<<Pole[j]<<" ";
cout<<endl;
}