korCZis
public text v1 · immutable#include <iostream>
#include <map>
#include <string>
using namespace std;
typedef std::map<std::string,int> MojeMapa;
typedef std::pair<std::string,int> MujPar;
int main(int argc, char** argv)
{
MojeMapa mapa;
mapa.insert(MujPar("Hello World!",2));
mapa.insert(MujPar("Hello others!",1));
cout << "Hello world! = " << mapa["Hello World!"] << endl;
cout << "Hello others! = " << mapa["Hello others!"] << endl;
return 0;
};
// Console output
Hello world! = 2
Hello others! = 1