PAT乙级1041
https://pintia.cn/problem-sets/994805260223102976/problems/994805281567916032
1 #include<iostream> 2 #include<stdio.h> 3 #include<string.h> 4 #include<algorithm> 5 #include<cmath> 6 #include<vector> 7 #include<queue> 8 #include<bits/stdc++.h> 9 using namespace std; 10 struct node 11 { 12 string a; 13 int shiji; 14 int zhengshi; 15 }e[1005]; 16 17 int main() 18 { 19 int n; 20 cin>>n; 21 for(int i=0;i<n;i++) 22 { 23 cin>>e[i].a>>e[i].shiji>>e[i].zhengshi; 24 } 25 int m,k; 26 cin>>m; 27 for(int j=0;j<m;j++) 28 { 29 cin>>k; 30 for(int i=0;i<n;i++) 31 {if(k==e[i].shiji) 32 cout<<e[i].a<<" "<<e[i].zhengshi<<endl; 33 continue; 34 } 35 } 36 return 0; 37 }