PAT-A1036
来源:互联网 发布:淘宝服装店铺文案 编辑:程序博客网 时间:2024/04/30 14:39
#include<stdio.h>#include<string.h>struct pnode{char name[12], ID[12];char gender;int grade;}temp,high, low;int main(){int i, n;high.grade=-1; low.grade=200;scanf("%d",&n);for(i=0;i<n;i++){scanf("%s %c %s %d", temp.name,&temp.gender,temp.ID,&temp.grade);if(temp.gender=='F' && temp.grade>high.grade) {high.grade=temp.grade; strcpy(high.ID,temp.ID); strcpy(high.name,temp.name);}if(temp.gender=='M' && temp.grade<low.grade) {low.grade=temp.grade; strcpy(low.ID,temp.ID); strcpy(low.name,temp.name);}}if(high.grade!=-1)printf("%s %s\n",high.name,high.ID);else printf("Absent\n");if(low.grade!=200)printf("%s %s\n",low.name,low.ID);else printf("Absent\n");if(high.grade!=-1&&low.grade!=200)printf("%d\n",high.grade-low.grade);else printf("NA\n");return 0;}
0 0
- [PAT] A1036
- PAT A1036
- PAT-A1036
- PAT a1036题解
- A1036
- 【PAT】A1036. Boys vs Girls (25)
- PAT A1036. Boys vs Girls (25)
- PAT-A1036 Boys vs Girls(25) (模拟)
- A1036 Boys vs Girls
- tsinsen A1036. 分解质因数
- A1036. 分解质因数
- 清澄A1036. 分解质因数
- A1036. Boys vs Girls (25)
- 刷清橙OJ--A1036.分解质因数
- 清橙OJ A1036.分解质因数
- pat
- 【PAT】
- PAT
- Central Processing Unit及集成电路
- PAT-A1035
- iOS星级评价效果
- Java中常用的集合小结
- Mac 修改host
- PAT-A1036
- Activity-Fragment存储与返回
- PAT-A1037
- dyld: Library not loaded: @rpath/libswiftCore.dylib / Image not found
- Linux 添加/删除用户和用户组
- PAT-A1038
- angular js(2)和ionic(2)的总结
- C# 利用委托实现窗体间传值
- PAT-A1039