1. This is a dictionary tree problem, but you can do it with map
2. Code:
#include <cstdio> #include <cstring> #include <iostream> #include <map>using namespace Std;map    <string,string> Mp;char S[30100],ss[15];int Main () {scanf ("%s", s);        while (1) {scanf ("%s", s);        if (strcmp (S, "END") ==0) break;        scanf ("%s", SS);        String s1,s2;        int Len1=strlen (s);        int Len2=strlen (ss);        for (int i=0; i<len1; i++) {s1+=s[i];        } for (int i=0; i<len2; i++) {s2+=ss[i];    } mp.insert (Make_pair (S2,S1));    } Map<string,string>::iterator it; /*for (It=mp.begin (); It!=mp.end (); it++) {cout<< (It->first) << "" << (It->second) <<end    L    }*/scanf ("%s", s);    GetChar ();        while (1) {gets (s);        GetChar ();        if (strcmp (S, "END") ==0) {break;        } int Len=strlen (s);        S[len]= ";        String sss;      for (int i=0; i<=len; i++)  {if (s[i]>=97&&s[i]<=122) {sss+=s[i];                        } else {if (sss.size () ==0) {if (I!=len)                    cout<<s[i];                Continue                    } else {it=mp.find (SSS);                    if (It!=mp.end ()) {cout<<it->second;                    } else {cout<<sss;                    } if (I!=len) cout<<s[i];                Sss.clear ();    }}} cout<<endl; } return 0;}
 
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
 
HDU 1075 What is your talking about (give you a dictionary, let you translate sentences, words not found in the dictionary do not translate)