mirror of
https://github.com/renbaoshuo/202401-programming-assignments.git
synced 2024-12-16 15:44:39 +00:00
14 lines
259 B
C
14 lines
259 B
C
ST* MaxST(ST d[], int n, int k) {
|
|
ST* res = NULL;
|
|
|
|
for (int i = 0; i < n; i++) {
|
|
if (d[i].gender == k) {
|
|
if (res == NULL || d[i].scored > res->scored) {
|
|
res = &d[i];
|
|
}
|
|
}
|
|
}
|
|
|
|
return res;
|
|
}
|