本文共 648 字,大约阅读时间需要 2 分钟。
题目链接:https://www.patest.cn/contests/pat-a-practise/1036
#include#include #include #include #include #include #include using namespace std;struct Node{ char name[11],id[11],sex; int grade;};int main(){ int n; scanf("%d",&n); vector male,female; for (int i=0; i b.grade; }); bool flag = false; if(female.size()) printf("%s %s\n",female[0].name,female[0].id); else{ printf("Absent\n"); flag = true; } if(male.size()) printf("%s %s\n",male[0].name,male[0].id); else{ printf("Absent\n"); flag = true; } if(flag) printf("NA\n"); else printf("%d\n",female[0].grade-male[0].grade); return 0;}
转载地址:http://uqhji.baihongyu.com/