1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-12-16 15:44:39 +00:00
202401-programming-assignments/【实践课外】15.结构体1/6-1 选队长.c

12 lines
295 B
C
Raw Normal View History

2024-12-11 03:41:51 +00:00
void showCaptain(TeamMember team[], int n) {
TeamMember res = team[0];
for (int i = 1; i < n; i++) {
if (team[i].ability > res.ability) {
res = team[i];
}
}
printf("%d %s %s %s %.2lf\n", res.id, res.lastname, res.firstname, res.sex, res.ability);
}