题目大意:一本字典,列出一系列的单词和的对应的外语,给出一系列外语,求这些外语是否在字典中出现过
解题思路:map的使用
#include<cstdio>
#include<cstring>
#include<iostream>
#include<map>
using namespace std;
string str[10000];
int main() {
map<string,string> m;
char str[100],e[15],f[15];
while(gets(str),str[0]) {
sscanf(str,"%s%s",e,f);
m[f] = e;
}
while(gets(f))
m.find(f) != m.end() ? cout << m[f] << endl :cout << "eh" << endl;
return 0;
}