慕哥9229398
typedef struct{int key;int other;}rectype;rectype K[n];//筛选算法void sitf(rectypt K[],int i,int m)//在数组K[i]到K[m]中,调整K[i]{int j;rectype temp;temp=K[i];j=2*i;while(j=m){if((j<m) && (K[j].key<K[j+1].key))j++;if(temp.key<K[j].key){K[i]=K[j];i=j;j=2*i;}elsebreak;}K[i]=temp;}//堆排序算法void heapsort(rectype K[]){int i;rectype temp;for(i=n/2;i>=1;i--)sift(K,i,n);for(i=n;i>1;i--){temo=K[1];K[1]=K[i];K[i]=temp;sift(K,1,i-1);}}