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> ...
随机推荐
- Struts2的零配置和rest插件
1. 零配置使用struts2-convention-plugin-2.3.16.jar,rest使用struts2-rest-plugin-2.3.16.jar 1.1 Struts2的conven ...
- IE9+浏览器input文本框/密码框后面的小叉子/小眼睛清除
为了方便我们的触控操作,IE高等浏览器针对input及input type="password"分别提供了快速清除钮(X图标)以及密码文字显示钮(小眼睛图标)的功能. 由于这经常跟 ...
- 在jQuery环境下制作轻巧遮罩层
遮罩层的好处就是可以屏蔽用户对遮罩层下方元素的操作. 制作原理很简单:1设置遮罩层触发按钮 2设置遮罩层内容 3设置遮罩层背景(重点是捕获内容div的大小位置)4设置点击触发按钮遮罩层背景内容同时显示 ...
- DialogFragment
DialogFragment 从Android 3.0 (API level 11)开始引入,如果想在低于该版本的系统上使用,需用android.support.v4.app.DialogFragme ...
- python之平台独立的调试工具winpdb介绍
Winpdb is a platform independent graphical GPL Python debugger with support for remote debugging ove ...
- Linux系统下给VMWare安装Tools
1.进入Linux系统. 2.在VMware的窗口菜单中选VM >> install VMware Tools,虚拟机自动将VMware-tools装入虚拟光驱中. 3.在虚拟光驱里找出V ...
- swift项目-模仿团购(主界面的搭建,以及首页的一些细节)
以前学习oc的时候写的一个团购的项目,现在学习swift,拿来用swift写一遍,也是连猜带蒙的,一点一点的往上凑. 今天主要是把主要的架子搭起来了. 主要有:UITabBarController,U ...
- UINavigationController切换视图的简单使用
UINavigationController通过栈的方式来管理视图,通过push将视图压入栈,pop将视图推出栈. 下面通过简单的示例说明 AppDelegate.m - (BOOL)applicat ...
- WIN32一些文件及窗口操作
0,获取指定的系统路径: #include <shlobj.h> #pragma comment(lib, "shell32.lib") TCHAR szPat ...
- 一种简单的权限管理ER图设计
权限管理支持动态地管理用户的角色和权限.权限代表用户可以在什么对象上进行什么操作:角色是一组权限的集合. PS:当增加或删除某个用户的角色时,系统自动将该角色对应的权限(角色 -权限关联表)增加或删除 ...