1036. Boys vs Girls (25)
#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)的更多相关文章
- PAT 甲级 1036 Boys vs Girls (25 分)(简单题)
1036 Boys vs Girls (25 分) This time you are asked to tell the difference between the lowest grade ...
- PAT 1036 Boys vs Girls (25 分)
1036 Boys vs Girls (25 分) This time you are asked to tell the difference between the lowest grade ...
- 1036 Boys vs Girls (25分)(水)
1036 Boys vs Girls (25分) This time you are asked to tell the difference between the lowest grade o ...
- PAT甲级:1036 Boys vs Girls (25分)
PAT甲级:1036 Boys vs Girls (25分) 题干 This time you are asked to tell the difference between the lowest ...
- PATA 1036. Boys vs Girls (25)
https://www.patest.cn/contests/pat-a-practise/1036 #include <bits/stdc++.h> using namespace st ...
- PAT 1036 Boys vs Girls (25分) 比大小而已
题目 This time you are asked to tell the difference between the lowest grade of all the male students ...
- PAT甲题题解-1036. Boys vs Girls (25)-找最大最小,大水题
题意:给出n个人的姓名.性别.ID.分数,让你找出其中哪个妹纸分数最高.哪个汉子分数最低.以及他们的差如果没有妹纸或者汉子,则对应输出Absent,差用NA代替. 就是for一遍找最大最小值,水题 # ...
- 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 ...
- PAT (Advanced Level) 1036. Boys vs Girls (25)
简单题. #include<iostream> #include<cstring> #include<cmath> #include<algorithm> ...
随机推荐
- CEF js调用C#封装类含注释
/* * CEF JS调用C#组装类 * * 使用方法(CefGlue为例): * public class BrowserRenderProcessHandler : CefRenderProces ...
- C#动态加载程序集(转)
C#动态加载程序集 今天在看网络上的一篇关于‘.NET应用自动部署窗体技术’.NET的自动部署技术构造在.NET框架之中,它使得应用程序能够通过HTTP连接从远程服 务器按需下载程序集.有了这个功能, ...
- 代理和 block 传值的使用
// // ZYViewController.h // BlockTest // // Created by yejiong on 14/11/2. // Copyright © 2014年 zzz. ...
- Python 中使用optparse进行参数解析
使用过Linux/Unix的人都会知道,命令行下的很多命令都需要参数,在C语言中添加和解析参数比较繁琐.Python中提供了optparse模块可以非常方便地处理命令行参数. 1 命令行参数的样 ...
- js判断图片上传时的文件大小,和宽高尺寸
今天在做图片上传的小功能,使用了一个kissy上传组件.很好奇它是如何在图片上传前,检测到图片的大小和尺寸的?我们来写个小实例实现一下吧 如何读取图片的size 首先,原生input file控件有个 ...
- CentOS(十)--与Linux文件和目录管理相关的一些重要命令②
在结束了第二期的广交会实习之后,又迎来了几天休闲的日子,继续学习Linux.在上一篇随笔 Linux学习之CentOS(十七)--与Linux文件和目录管理相关的一些重要命令① 中,详细记录了与Lin ...
- PHPnow开启PHP扩展里openssl支持的方法
PHPnow 是 Win32 下绿色的 Apache + PHP + MySQL 环境套件包.简易安装.快速搭建支持虚拟主机的 PHP 环境.更多介绍<PHP服务套件 PHPnow1.5.6&g ...
- Nginx HTTP User_agent
假设我这里有大量图像.CSS.javascript等静态文件,分别放在后端服务器 192.168.1.5 和 192.168.1.6上,那么我如何利用nginx的反向代理功能将不同的 http_us ...
- .net中判断该应用程序是否已经启动,防止重复启动,监控程序启动是否正常
//获取配置文件中的需要监控项 private static string MonitorServe = ConfigurationSettings.AppSettings["Monitor ...
- 并行执行的Service,以媒体转码成新格式为例
大家众所周知,IntentService内置的handler只有一个线程,而AsyncTask又只适合时间至多几秒的操作,所以我们关注使用ExecutorService建立并行执行.为了确保Servi ...