... HAVE U TRIED .... AT LEAST 3 TIMES ... OK U CAN SEE THIS ...

Tuesday, December 24, 2013

UVA-12592 :: Slogan Learning of Prince

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cstring>
#include <map>
using namespace std;
int main ()
{

     map<string,string>mp;
     string s1,s2;
    int n,q,m,i,j,k;
     cin>>n;
     getchar();
     for(i=0;i<n;i++)
{
     getline(cin,s1);
     getline(cin,s2);
     mp[s1]=s2;

}
cin>>q;
getchar();
while(q--)
{
     cin>>s1;
     cout<<mp[s1]<<endl;
}

return 0 ;
}