![这里写图片描述](https://img-blog.csdn.net/20170723192804947?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcXdxMTUwMw==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
![这里写图片描述](https://img-blog.csdn.net/20170723192818496?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcXdxMTUwMw==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
![这里写图片描述](https://img-blog.csdn.net/20170723192834151?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcXdxMTUwMw==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
#include <stdio.h>
struct person{
char name[15];
char id[15];
int score;
}M,F,temp;
void init()
{
M.score = 101;
F.score = -1;
}
int main()
{
init();
int n;
char gender;
scanf("%d", &n);
for (int i=0; i<n; i++){
scanf("%s %c %s %d", temp.name, &gender, temp.id, &temp.score);
if (gender == 'M' && temp.score < M.score){
M = temp;
}else if (gender == 'F' && temp.score > F.score){
F = temp;
}
}
if (F.score == -1){
printf("Absent
");
}else{
printf("%s %s
", F.name, F.id);
}
if (M.score == 101){
printf("Absent
");
}else{
printf("%s %s
", M.name, M.id);
}
if (F.score == -1 || M.score == 101){
printf("NA
");
}else{
printf("%d
", F.score - M.score);
}
return 0;
}
![这里写图片描述](https://img-blog.csdn.net/20170723192900313?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcXdxMTUwMw==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)