#include <stdio.h>
#include <string.h>
int main()
{
int n,i;
while(scanf("%d",&n)!=EOF)
{
char ManID[11]="",FelID[11]="",ManName[11],FelName[11];
char TemID[11],TemName[11],Gender;
int TemGrade,MaxGrade=-1,MinGrade=101;
for(i=0;i<n;i++)
{
getchar();
scanf("%s %c %s %d",TemName,&Gender,TemID,&TemGrade);
if(Gender=='M')
{
if(MinGrade > TemGrade)
{
strcpy(ManName,TemName);
strcpy(ManID,TemID);
MinGrade = TemGrade;
}
}
else
{
if(MaxGrade < TemGrade)
{
strcpy(FelName,TemName);
strcpy(FelID,TemID);
MaxGrade = TemGrade;
}
}
}
int complete=1;
if(strcmp(FelID,"")==0)
{
printf("Absent\n");
complete=0;
}
else printf("%s %s\n",FelName,FelID);

if(strcmp(ManID,"")==0)
{
printf("Absent\n");
complete=0;
}
else printf("%s %s\n",ManName,ManID);

if(complete) printf("%d\n",MaxGrade-MinGrade);
else printf("NA\n");
}
return 0;
}

1036. Boys vs Girls (25)的更多相关文章

  1. PAT 甲级 1036 Boys vs Girls (25 分)(简单题)

    1036 Boys vs Girls (25 分)   This time you are asked to tell the difference between the lowest grade ...

  2. PAT 1036 Boys vs Girls (25 分)

    1036 Boys vs Girls (25 分)   This time you are asked to tell the difference between the lowest grade ...

  3. 1036 Boys vs Girls (25分)(水)

    1036 Boys vs Girls (25分)   This time you are asked to tell the difference between the lowest grade o ...

  4. PAT甲级:1036 Boys vs Girls (25分)

    PAT甲级:1036 Boys vs Girls (25分) 题干 This time you are asked to tell the difference between the lowest ...

  5. PATA 1036. Boys vs Girls (25)

    https://www.patest.cn/contests/pat-a-practise/1036 #include <bits/stdc++.h> using namespace st ...

  6. PAT 1036 Boys vs Girls (25分) 比大小而已

    题目 This time you are asked to tell the difference between the lowest grade of all the male students ...

  7. PAT甲题题解-1036. Boys vs Girls (25)-找最大最小,大水题

    题意:给出n个人的姓名.性别.ID.分数,让你找出其中哪个妹纸分数最高.哪个汉子分数最低.以及他们的差如果没有妹纸或者汉子,则对应输出Absent,差用NA代替. 就是for一遍找最大最小值,水题 # ...

  8. 1036 Boys vs Girls (25)(25 point(s))

    problem This time you are asked to tell the difference between the lowest grade of all the male stud ...

  9. PAT (Advanced Level) 1036. Boys vs Girls (25)

    简单题. #include<iostream> #include<cstring> #include<cmath> #include<algorithm> ...

随机推荐

  1. ArcGIS Server 10.2 实战(二)动态修改要素数据的地理处理服务

    上一篇<ArcGIS Server 10.2 实战(一)Asp.net MVC与JSON数据妙用实现动态生成要素图层>介绍了如何用JSON转要素的地理处理服务,实现了动态创建点要素并加载到 ...

  2. iaas,paas,saas理解

    IaaS.PaaS.SaaS多次看到这几个单词,今天仔细看看来, ​这几个词和云计算相关:1,iaaS,Hardware-as-a-Service,信息,硬件服务,服务器,存储和网络硬件,网络存储,带 ...

  3. okhttputils开源库的混淆配置(Eclipse)

    #=====================okhttputils框架===================== #====okhttputils==== -libraryjars libs/okht ...

  4. Git CMD - clone: Clone a repository into a new directory

    命令格式 git clone [--template=<template_directory>]  [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare ...

  5. C#算法基础之希尔排序

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...

  6. ContentProvider(一)

    注册ContentProvider: <provider android:name=".provider.UserProvider" android:authorities= ...

  7. hive 未初始化元数据库报错

    启动hive-metastore和hive-server2 用beeline连接hive报错 [root@node04 hive]# beeline Beeline version 0.13.1-cd ...

  8. phpwind wap功能添加百度wap统计

    百度推出wap统计功能后,及大的方便了个站长对wap网站的统计.PHPWIND自带的wap功能虽然说功能不是太强,但是对百度来说是非常友好的,如果再进一不优化一下页面模板,这样会对网友访问网站信息有非 ...

  9. Kill Session

    有时候创建索引或修改表字段时,会提示资源正忙,可以查出表对应的进程并kill掉 select l.session_id,o.owner,o.object_name from v$locked_obje ...

  10. Eclipse 调试maven test

    在eclipse中调试maven test 一般情况下,使用如下方式都不能使myeclipse检测到程序中的断点: 项目 -> Run As -> maven test 或 项目 -> ...