插入排序:
void insertsort(int* a,int n)
{
int key;
for(int j=1;j {
key = a[j];
for(int i=j-1;i>=0&&a[i]>key;i--)
a[i+1] = a[i];
}
a[i+1] = key;
编辑特别推荐: