// File: map1.C
//
// Testing the STL map class.
// Example modified from documentation on <www.sgi.com/Technology/STL/>

#include <iostream.h>
#include <iomanip.h>
#include <stdlib.h>
#include <string.h> // C string library
#include <map>      // STL map
#include <string>   // STL string class


typedef map<string, int> mmap ;

int main() {
   mmap months;

   months["january"] = 31;
   months["february"] = 28;
   months["march"] = 31;
   months["april"] = 30;
   months["may"] = 31;
   months["june"] = 30;
   months["july"] = 31;
   months["august"] = 31;
   months["september"] = 30;
   months["october"] = 31;
   months["november"] = 30;
   months["december"] = 31;

   cout << "December has " << months["december"] << " days" << endl ;

   mmap::iterator it ;

   for (it = months.begin() ; it != months.end() ; it++) {
      cout << (*it).first << " has " ;
      cout << (*it).second << " days" << endl ;
   }
}
