#include <iostream> #include <cstdio> #include <string> #include <map> using namespace std; int main(){ string a; int b,c; int m,n; int d; map<int,string> mp1; map<int,int> mp2; cin>>n; for(int i=0;i<n;i++){ cin>>a; cin>>b; cin>>c; mp1[b]=a; mp2[b]=c; } cin>>m; for(int i=0;i<m;i++){ cin>>d; if(i==0){ cout<<((mp1.find(d))->second)<<" "<<((mp2.find(d))->second); } else{ cout<<endl<<((mp1.find(d))->second)<<" "<<((mp2.find(d))->second); } } return 0; }
map的使用