/*
2010-4-10 wcdj
*/
#include
#include
#include
#include
#include // pair
using namespace std;
int main()
{
map > > mfamily;
string surname;
vector > pchildren;
while (1)
{
cout<
cin>>surname;
if(!cin)
break;
// error, the same surnames maybe have
//++mit->first=surname;// -> is prior to ++
// ok
// first way
pair > >::iterator, bool > ret=
mfamily.insert(map > >::value_type(surname,pchildren));
// second way
/*
pair > >::iterator, bool > ret=
mfamily.insert(make_pair(surname,pchildren));
*/
if (!ret.second)
{
cout<
continue;
}
cout<
string childrenName;
int nAge;
while (cin>>childrenName>>nAge)
{
ret.first->second.push_back(make_pair(childrenName,nAge));
}
cin.clear();
}
cin.clear();
// search
while(1)
{
cout<
cin>>surname;
if(!cin)
break;
map > >::const_iterator mit=mfamily.find(surname);
if (mit==mfamily.end())
{
cout<
}
else
{
cout<
cout<
vector >::const_iterator iter=mit->second.begin();
cout<
for (;iter!=mit->second.end();++iter)
{
cout<first<second<
//cout<
}
}
}
system("pause");
return 0;
}