#include "table.h" #include #include #include #include int main() { std::cout << "Enter n: "; unsigned n { }; std::cin >> n; std::cout << "Enter words: "; Hash_Table table { }; for (unsigned i { 0 }; i < n; ++i) { std::string word { }; std::cin >> word; if (table.contains(word)) ++table.lookup(word); else table.insert(word, 1); } std::cout << std::endl; std::vector keys { table.keys() }; for (std::string const& key : keys) std::cout << table.lookup(key) << " (" << key << ")" << std::endl; }