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.
625 B
625 B
// 11函数功能:交换法实现字符串按字典顺序排序
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<n; j++)
{
if (stu[j].num < stu[k].num) k = j;
}
if (k != i)
{
for (t=0; t<m; t++)
{
SwapFloat(&stu[k].score[t], &stu[i].score[t]);
}
SwapFloat(&stu[k].sum, &stu[i].sum);
SwapFloat(&stu[k].aver, &stu[i].aver);
SwapLong(&stu[k].num, &stu[i].num);
SwapChar(stu[k].name, stu[i].name);
}
}
}