>>382 #include <iostream>
#include <fstream>
#include <map>
#include <string>
main()
{
using namespace std;
map<string, int> strmap;
ifstream file2("file2");
while(file2)
{
int i;
string s;
file2 >> i;
file2 >> s;
strmap[s] = i;
}
ifstream file1("file1");
string s;
while(file1 >> s)
{
map<string, int>::iterator it = strmap.find(s);
if(it != strmap.end())
{
cout << (*it).first << " " << (*it).second << endl;
}
}
}