# include # include "string.C" # include "table.h" # include // use a dictionary for the translation table dictionary trTable; void fillTrTable(string & fileName) { ifstream in(fileName); string word(100); string wordTranslation(100); while (in >> word >> wordTranslation) trTable[word] = wordTranslation; } main () { string word(100); // read the file of word pairs fillTrTable("words"); // read input text, printing out translations while (cin >> word) if (trTable.includesKey(word)) cout << " " << trTable[word]; else cout << " [" << word << "]"; }