#include<stdio.h>
void fun(int a[],int n);
int main()
{
int i,j=0,k=0,n,a[100];
scanf("%d",&n);
for(i=0;i<n;i++)
{scanf("%d",&a[i]);
}
fun(a,n);
for(i=0;i<n;i++)
{if(i%2==0)
{printf("%d ",a[j]);j++;
}
else
{printf("%d ",a[n-1-k]);k++;
}
}
return 0;
}
void fun(int a[],int n)
{
int i,j,t;
for(i=0;i<n;i++)
{for(j=i+1;j<n;j++)
{if(a[i]>a[j])
{t=a[i];
a[i]=a[j];
a[j]=t;
}
}
}
}
标签:int,void,11.24,++,printf,fun,scanf From: https://blog.51cto.com/u_15758636/5884454