#include "iostream"
#include "string"
#include "map"
using namespace std;
int main()
{
map<string, string> m;
string str1, str2;
while (getline(cin, str1) && str1 != "")//从行输入中分隔两个字符串出来!
{
int length, size;
string temp1 = "", temp2 = "";
size = str1.size();
length = str1.find(' ');
for (int i = 0; i < length; i++)
temp1 += str1[i];
for (int j = length + 1; j < size; j++)
temp2 += str1[j];
m.insert(pair<string, string>(temp2, temp1));
}
while (cin >> str2)
{
if (m.find(str2) != m.end())//在映射器中查找的结果
cout << m[str2] << endl;
else
cout << "eh" << endl;
}
}
zoj 1109 Language of FatMouse
最新推荐文章于 2017-08-12 15:26:10 发布