#include<iostream>
#include<map>
#include<algorithm>
using namespace std;
int main()
{
map<int,int>map1{{1,2},{2,3},{3,5},{4,7},{5,11}};
cout<<map1.at(3)<<endl;
cout<<map1[3]<<endl;
map1[6];
for(map<int,int>::iterator it=map1.begin();it!=map1.end();it++)
{
cout<<it->first<<" "<<it->second<<endl;
}
cout<<endl;
cout<<"----------------------"<<endl;
map1.insert(pair<int,int>(7,17));
map1.insert(make_pair(8,23));
for(map<int,int>::iterator it=map1.begin();it!=map1.end();it++)
{
cout<<it->first<<" "<<it->second<<endl;
}
cout<<endl;
map<int,int>::iterator its=map1.find(2);
map1.erase(its);
for(map<int,int>::iterator it=map1.begin();it!=map1.end();it++)
{
cout<<it->first<<" "<<it->second<<endl;
}
cout<<endl;
auto itss=map1.begin();
auto itss2=map1.end();
map1.erase(itss,itss2);
for(map<int,int>::iterator it=map1.begin();it!=map1.end();it++)
{
cout<<it->first<<" "<<it->second<<endl;
}
cout<<endl;
return 0;
}