A1036
来源:互联网 发布:winpe装linux 编辑:程序博客网 时间:2024/05/18 00:19
#include <stdio.h>struct person{ char name[15]; // 姓名 char id[15]; // ID int score; // 分数 }M,F,temp;void init(){ M.score = 101; // 男生的最低分,女生的最高高分 F.score = -1; }int main(){ init(); int n; char gender; scanf("%d", &n); for (int i=0; i<n; i++){ scanf("%s %c %s %d", temp.name, &gender, temp.id, &temp.score); if (gender == 'M' && temp.score < M.score){ M = temp; }else if (gender == 'F' && temp.score > F.score){ F = temp; } } if (F.score == -1){ printf("Absent\n"); //没有女生 }else{ printf("%s %s\n", F.name, F.id); } if (M.score == 101){ printf("Absent\n"); //没有男生 }else{ printf("%s %s\n", M.name, M.id); } if (F.score == -1 || M.score == 101){ printf("NA\n"); }else{ printf("%d\n", F.score - M.score); } return 0;}
阅读全文
0 0
- A1036
- [PAT] A1036
- PAT A1036
- PAT-A1036
- A1036 Boys vs Girls
- tsinsen A1036. 分解质因数
- A1036. 分解质因数
- PAT a1036题解
- 清澄A1036. 分解质因数
- A1036. Boys vs Girls (25)
- 刷清橙OJ--A1036.分解质因数
- 清橙OJ A1036.分解质因数
- 【PAT】A1036. Boys vs Girls (25)
- PAT A1036. Boys vs Girls (25)
- PAT-A1036 Boys vs Girls(25) (模拟)
- 【MySQL】基础知识
- Aizu
- nginx
- jsp自定义标签(时间格式化包括Long转时间)
- laravel的 容器container(ioc)
- A1036
- 稳定排序
- 12. Integer to Roman
- redis集群命令
- hadoop2.x入门:编写mapreduce对气象数据集求每日最高气温和最低气温
- Android—(通知、闹钟)
- 音译 —— 本身的含义
- MongoDB学习
- LeetCode 371. Sum of Two Integers