#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
struct node
{
char name[25];
char gender;
char id[25];
int grade;
}F,M,T;
void init()
{
M.grade=101;//MAN要的是最低分
F.grade=-1;
}
int main()
{
// freopen("in.txt","r",stdin);
init();
int N;
scanf("%d",&N);
while(N--)
{
scanf("%s %c %s %d",T.name,&T.gender,T.id,&T.grade);
if(T.gender == 'M' && T.grade < M.grade)
{
M = T;
}
else if(T.gender == 'F' && T.grade > F.grade)
{
F = T;
}
}
if(F.grade == -1)
printf("Absent\n");
else
printf("%s %s\n",F.name,F.id);
if(M.grade == 101)
printf("Absent\n");
else
printf("%s %s\n",M.name,M.id);
if(F.grade == -1 || M.grade == 101)
printf("NA\n");
else
printf("%d\n",F.grade - M.grade);
return 0;
}
1036. Boys vs Girls (25)
最新推荐文章于 2022-05-29 20:02:17 发布