#include <iostream>
#include <conio.h>
#include <math.h>
using namespace std;
int main()
{
const int n=4;
int a[n];
bool c;
int g,j,p,i,t;
for (i=1;i<=n;i++)
{cout<<"Vvedite chisla"; cin>>a[i];}
g=(n+1)/2;
while (g>0)
{
p=g;
j=p-g;
c=true;
if (a[j]<=a[j+g]){c=false;}
else
{
t=a[j];
a[j]=a[j+g];
a[j+g]=t;
}
j=j-1;
while (j>=0)
{
if (a[j]<=a[j+g]){c=false;}
else
{
t=a[j];
a[j]=a[j+g];
a[j+g]=t;
}
j=j-1;
}
p=p+1;
while (p<=n)
{
j=p-g;
c=true;
if (a[j]<=a[j+g]){c=false;}
else
{
t=a[j];
a[j]=a[j+g];
a[j+g]=t;
}
j=j-1;
while (j>=0)
{
if (a[j]<=a[j+g]){c=false;}
else
{
t=a[j];
a[j]=a[j+g];
a[j+g]=t;
}
j=j-1;
}
p=p+1;
}
g=g-1;
}
for (i=1;i<=n;i++)
cout<<"a["<<i<<"] === "<<a[i];
_getch();
}