You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
// 10函数功能:按选择法将数组num的元素值按从低到高排序
|
|
|
|
|
void AsSortbyNum(STU stu[], int n, int m)
|
|
|
|
|
{
|
|
|
|
|
int i, j, k, t;
|
|
|
|
|
for (i=0; i<n-1; i++)
|
|
|
|
|
{
|
|
|
|
|
K=i;
|
|
|
|
|
for(j=i+1;j<10;j++)
|
|
|
|
|
{
|
|
|
|
|
if((*compare)(stu[k]num.stu[j].num)) k=j;}
|
|
|
|
|
if(k!=i)
|
|
|
|
|
{t=stu[i].num;stu[i].num=stu[k].num;stu[k].num=t;}
|
|
|
|
|
}
|
|
|
|
|
}
|