#include <stdio.h>
#include <string.h> //调用字符串函数
const int maxSize=110;
struct student{
char name[15];
char id[15];
} score[maxSize]; //定义结构体
int main()
{
int n, i, num, low=110, high=-1;
char name[15], id[15]; //此处应定义为字符数组,且要大于10,因为要留一个位置给'\0'
scanf("%d", &n);
for (i=0; i<n; i++) {
scanf("%s %s %d", &name, &id, &num);
strcpy(score[num].name,name); //字符串赋值
strcpy(score[num].id,id);
if (num<=low) low=num;
if (num>=high) high=num;
}
printf("%s %s\n", score[high].name, score[high].id);
printf("%s %s\n", score[low].name, score[low].id);
}
1、不难,关于字符串操作不是很熟。