13,825
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
#include <stdlib.h>
typedef struct {
char name[11];
char ID[11];
int score;
} student;
student high = {"", "", 0}, low = {"", "", 100}, in;
int n;
int main()
{
scanf("%d", &n);
for (; n; n--) {
scanf("%s %s %d", in.name, in.ID, &in.score);
if (in.score >= high.score) high = in;
if (in.score <= low.score) low = in;
}
printf("%s %s\n", high.name, high.ID);
printf("%s %s\n", low.name, low.ID);
return 0;
}