{
inti,j;
inttemp;
for(i=first+1;i<last;i++)
temp=array[i];
j=i-1;
//與已排序的數逐壹比較,大於temp時,該數移後
while((j>=0)&&(array[j]>temp))
array[j+1]=array[j];
j--;
}
//存在大於temp的數
if(j!=i-1)
{array[j+1]=temp;}