#include<map> #include<iostream> using namespace std; typedef struct{ string name; string age; char sex; }Stu; int main(){ Stu stu[1002]; int n; cin>>n; for(int i=0;i<n;i++){ cin>>stu[i].name>>stu[i].age>>stu[i].sex; } int m; cin>>m; string s1,s2; int t1,t2; while(m--){ cin>>s1>>s2; for(int i=0;i<n;i++){ if(stu[i].name==s1||stu[i].age==s1){ t1 = i; } if(stu[i].name==s2||stu[i].age==s2){ t2 = i; } } if(stu[t1].sex!=stu[t2].sex) cout<<'Y'<<endl; else cout<<'N'<<endl; } }
0.0分
0 人评分
点我有惊喜!你懂得!浏览:1238 |
大神老白 (C语言代码)浏览:715 |
奖学金 (C++代码)浏览:2008 |
C语言训练-字符串正反连接 (C语言代码)浏览:622 |
C语言程序设计教程(第三版)课后习题6.1 (C语言代码)浏览:454 |
2003年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:674 |
2006年春浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:647 |
WU-复数求和 (C++代码)浏览:2015 |
C语言程序设计教程(第三版)课后习题9.8 (C语言代码)浏览:616 |
C语言程序设计教程(第三版)课后习题9.10 (C语言代码)浏览:557 |