# include & lt; Stdio. H>
Int main ()
{
int n;
The scanf (" % d ", & amp; N);
Int a [n + 10];
Int I=0;
int j;
Int o [n].
Int ji [n].
Int k, l;
K=l=0;
While (the scanf (" % d ", & amp; A [I])!=(EOF)
{
If (a [I]==0)
{
break;
}
If ((I + 1) % 2==0)
{
O=[k] a [I];
K++;
}
If ((I + 1) % 2!=0)
{
Ji=[l] a [I];
L++;
}
i++;
}
Int g;
for(i=0; i
For (j=I; j
G=o [I];
If (g
O [I]=o [j];
O [j]=g;
}
}
}
Int the g1;
for(i=0; i
For (j=I; j
G1=ji [I];
If (g1 & gt; Ji [I])
{
Ji [I]=ji [j];
Ji [j]=g1;
}
}
}
Int u=l;
Int p=0;
While (j> 0 & amp; & K> 0)
{
Printf (" % d % d ", ji [p], o [p]);
P++;
j--;
K -;
}
If (n % 2!=0)
{
Printf (" % d ", ji [u - 1));
}
return 0;
}
This is the code I wrote, please advise, where there is a problem, optimization can also