hdu 1075 What Are You Talking About(map)
题意:单词翻译
思路:map
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
#include<iostream> #include<stdio.h> #include<string.h> #include<map> using namespace std; map<string,string>mp; int main(){ string s1,s2; char c; cin>>s1; while(cin>>s1){ if(s1=="END")break; cin>>s2; mp[s2]=s1; } cin>>s1; getchar(); while(1){ s1=""; while(1){ scanf("%c",&c); if(c<'a'||c>'z')break; s1+=c; } if(c=='E')break; if(mp.find(s1)==mp.end())cout<<s1; else cout<<mp[s1]; printf("%c",c); } return 0; }