#include
int main()
{
int a[10];
int i,j,t;
printf("input 10 numbers:\n");
for (i=0;i<10;i++)
scanf("%d",&a[i]);
printf("\n");
for(j=0;j<9;j++)
for(i=0;i<9-j;i++)
if(a[i]>a[i+1])
{
t=a[i];
a[i]=a[i+1];
a[i+1]=t;
}
printf("the sorted numbers:\n");
for(i=0;i<10;i++)
printf("%d\n",a[i]);
printf("\n");
}input 10 numbers:
36
-0009
5555
78787
468
-900
5
25
88
66
the sorted numbers:
-900
-9
5
25
36
66
88
468
5555
78787
阅读(1184) | 评论(0) | 转发(0) |