# include <stdio.h>
int main(void)
{
int a[100];
int i,j,t,len;
scanf("%d",&len);
for(i=0;i < len;++i)
scanf("%d",&a[i]);
for(i=0;i < len;++i)
for(j=0;j < len-1-i;++j)
{
if(a[j]>a[j+1])
{
t = a[j];
a[j] = a[j+1];
a[j+1] = t;
}
}
for(i=0;i < len;++i)
printf("%d ",a[i]);
return 0;
}
冒泡排序
最新推荐文章于 2023-06-06 09:14:05 发布