提交时间:2024-01-25 08:23:26

运行 ID: 127203

#include<bits/stdc++.h> using namespace std; map<string,string> mp; string s; int main(){ while(true){ getline(cin,s); if(s==""){ break; } string a,b; bool flag=false; for(int i=0;s[i];++i){ if(flag){ b+=s[i]; } else{ if(s[i]==' '){ flag=true; continue; } a+=s[i]; } } mp[b]=a; } while(cin>>s){ if(mp[s]==""){ printf("eh\n"); } else{ cout<<mp[s]<<'\n'; } } return 0; }