代码无坑点
#include<cstdio>
#include<iostream>
using namespace std;
const int maxn=10000000;
struct node
{
char name[11];
char a;
char id[11];
int score;
};
int main()
{
int n;
cin>>n;
node highf,lowm;
highf.score=-1;
lowm.score=101;
for (int i=0;i<n;i++)
{
node now;
scanf("%s %c %s %d",now.name,&now.a,now.id,&now.score);
if (now.a=='M')
{
if(now.score<lowm.score)
lowm=now;
}
else
{
if(now.score>highf.score)
highf=now;
}
}
if(highf.score==-1)
printf("Absent\n");
else
printf("%s %s\n",highf.name,highf.id);
if(lowm.score==101)
printf("Absent\n");
else
printf("%s %s\n",lowm.name,lowm.id);
if(highf.score!=-1&&lowm.score!=101)
printf("%d",highf.score-lowm.score);
else
printf("NA");
}