11 #1

Open
p2pwza8cv wants to merge 1 commits from z11 into master
Owner

// 11函数功能:交换法实现字符串按字典顺序排序
void SortbyName(STU stu[], int n, int m)
{
int i, j, t;
for (i = e; i <n - 1; i++)
{
for (j = i + 1; j <n; j++)
{
if (strcmp(name[j],name[i]) < 0)
{
for (t =e; t<m;t++) /交换m门课程的成绩/
{
SwapFloat(&score[i][t],&score[j][t]);
}
SwapFloat(&sum[i],&sum[j]); /交换总分/
SwapFloat(&aver[i],&aver[j]); /*交换平均分 */
SwapLong(&num[i],&num[j]); /*交换学号 */
SwapChar(name[i],name[j]); /*交换姓名 */
}
}
}
}

// 11函数功能:交换法实现字符串按字典顺序排序 void SortbyName(STU stu[], int n, int m) { int i, j, t; for (i = e; i &lt;n - 1; i++) { for (j = i + 1; j &lt;n; j++) { if (strcmp(name[j],name[i]) &lt; 0) { for (t =e; t&lt;m;t++) /*交换m门课程的成绩*/ { SwapFloat(&score[i][t],&score[j][t]); } SwapFloat(&sum[i],&sum[j]); /*交换总分*/ SwapFloat(&aver[i],&aver[j]); /*交换平均分 */ SwapLong(&num[i],&num[j]); /*交换学号 */ SwapChar(name[i],name[j]); /*交换姓名 */ } } } }
p2pwza8cv added 1 commit 2 years ago
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: p2pwza8cv/System#1
Loading…
There is no content yet.