#include <iostream>
#include <map>
#include <algorithm>
#include <cstdlib>

using namespace std;

void PrintOut(const pair<string,string> &p) {
  cout << p.first << " goes " << p.second << endl;
}

int main(int argc, char **argv) {
  map<string,string> zoo;

  zoo["dog"] = "woof";
  zoo["cat"] = "meow";
  zoo["fish"] = "blub";
  zoo["seal"] = "ow ow ow";
  
  zoo["fox"];  // ♫ WHAT DOES THE FOX SAY? ♫
  auto it = zoo.find("fox");

  if (it == zoo.end())
    cout << "not found" << endl;
  else
    cout << "found" << endl;

  cout << "iterating:" << endl;
  for_each(zoo.begin(), zoo.end(), &PrintOut);

  return EXIT_SUCCESS;
}