如下:
# include<stdio.h>
main ( )
{ int a [11];
int i, j, t,n;
printf (" please input 10 n~:\n ");
for (i=1;i<=n;i++)
scanf(" %d ", &a[i]);
printf(" \n ");
for (i=1; i<=9; i++)
for (j=i+1; j<=10; j++)
if (a[i]>a[j])
{ t=a[i]; a[i]=a[j]; a[j]=t;}
printf (" the sorted numbers: \n ");
for (i=1; i<=10; i++)
printf(" %d ", a[i];
}