Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include<string>#include<map>#include<iostream>using namespace std;class Node{public:Node(){father=NULL;}Node *father;string name;};map<string,Node*> book;int main(){int num;int i=0;string fa,so;cin>>num;for(i=0;i<num;i++){cin>>fa;cin>>so;map<string,Node* >::iterator l_it;l_it=book.find(fa);if(l_it==book.end()){book[fa]=new Node();book[fa]->father=NULL;