#include
main()
{inta[11],i,j,t,k;
printf("Input10numbers:\n");
for(i=0;i
scanf("%d",&a[i]);
printf("\n");
for(j=0;j
if(a[i]>a[i+1])
{t=a[i];a[i]=a[i+1];a[i+1]=t;}
printf("Thesortednumbers:\n");
printf("%d",a[i]);
printf("請再輸入一個數:");
scanf("%d",&k);
if(a[i]>k)
{
j=i;
break;
}
for(i=9;i>=j;i--)//移動位置
a[i+1]=a[i];
a[j]=k;//插入值
printf("插入後的順序為:\n");
#include
main()
{inta[11],i,j,t,k;
printf("Input10numbers:\n");
for(i=0;i
scanf("%d",&a[i]);
printf("\n");
for(j=0;j
for(i=0;i
if(a[i]>a[i+1])
{t=a[i];a[i]=a[i+1];a[i+1]=t;}
printf("Thesortednumbers:\n");
for(i=0;i
printf("%d",a[i]);
printf("請再輸入一個數:");
scanf("%d",&k);
for(i=0;i
if(a[i]>k)
{
j=i;
break;
}
for(i=9;i>=j;i--)//移動位置
a[i+1]=a[i];
a[j]=k;//插入值
printf("插入後的順序為:\n");
for(i=0;i
printf("%d",a[i]);
}