标签:
#include<stdio.h>
int main()
{
int a[50],i,j,t,n;
//scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
printf("\n input number of date:");
scanf("%d",&n);
printf("input %d munbers:\n",n);
for(i=0;i<n;i++);
scanf("%d",&a[i]);
for(j=1;j<=n-1;j++)
for(i=0;i<=n-j-1;i++)
if(a[i]>a[i+1])
{
t=a[i];a[i]=a[i+1];a[i+1]=t;
}
for(i=0;i<n;i++)
printf("%4d",a[i]);
}
标签:
原文地址:http://www.cnblogs.com/woderenshengluwozijizou/p/4430063.html