Home > Back-end >  A problem about the STL help of new solutions
A problem about the STL help of new solutions

Time:09-16

Define an english-chinese translation dictionary, is stored in English words and Chinese words, provide insert, search, modify, and delete operations, on this basis, the implementation of a simple english-chinese translator, the main function of the input Chinese, output corresponding English words,

CodePudding user response:

Map M;
M.i nsert (pair (" apple ", "apple"));
M.i nsert (pair (" banana ", "banbana"));
M.i nsert (pair (" pear ", "pear"));
M.i nsert (pair (" peach ", "peach"));
String s;
While (true) {
Cin & gt; & gt; s;
If (s=="e")
Break;
Cout & lt; }
  • Related