1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
#include <iostream>
#include <string>
#include "Hash.hpp"

int main() {
   Hash<std::string, unsigned int> hash(32);
   std::string town; unsigned int population;
   while (std::cin >> town && std::cin >> population) {
      if (!hash.insert(std::make_pair(town, population))) {
	 std::cerr << "insertion of " << town << " failed." << std::endl;
      }
   }
   for (auto& object: hash) {
      std::cout << object.first << " " << object.second << std::endl;
   }
}