Associative maps.

Associative maps.

map

See version :

Pas de dépendances

Download :

#include <iostream>
#include <map>
#include <string>

using namespace std;

int main()
{
    map<string,int> m;
    m["janvier"] = 31;
    m["fevrier"] = 28;
    m["mars"] = 31;
    m["avril"] = 30;
    m["mai"] = 31;
    m["juin"] = 30;
    m["juillet"] = 31;
    m["aout"] = 31;
    m["septembre"] = 30;
    m["octobre"] = 31;
    m["novembre"] = 30;
    m["decembre"] = 31;
    int a = m.count("decembre");
    cout << "il y a " << m["mars"] << " jours en mars" << endl;
    return 0;
}



Explanations

	No explanations yet.