# include <cstdio>
# include <string>
# include <map>
# include <algorithm>
# include <iostream>
using namespace std;
int main()
{
map<string,string>q;
q.clear();
string str1,str2;;
while(cin>>str1)
{
if(str1=="START")
continue;
if(str1=="END")
break;
cin>>str2;
q[str2]=str1;
}
cin>>str1;
getchar();
char ch;
str1="";
while(1)
{
while(1)
{
scanf("%c",&ch);
if(!( (ch>='a'&&ch<='z')|| (ch>='A'&&ch<='Z') ))
break;
str1+=ch;
}
if(str1=="END")
break;
if(q.find(str1)==q.end())
cout<<str1;
else
cout<<q[str1];
str1="";
printf("%c",ch);
}
return 0;
}
hdu 1075 What Are You Talking About(map)
最新推荐文章于 2021-03-10 17:37:40 发布