#include <bits/stdc++.h>
using
namespace
std;
int
main()
{
unordered_multimap<
char
,
int
> sample;
sample.insert({
'a'
, 2 });
sample.insert({
'b'
, 4 });
sample.insert({
'c'
, 8 });
sample.insert({
'd'
, 10 });
sample.insert({
'c'
, 4 });
sample.insert({
'e'
, 4 });
sample.insert({
'f'
, 4 });
cout <<
" Elements of multimap are : \n"
;
for
(
auto
& x : sample)
cout << x.first <<
" : "
<< x.second << endl;
sample.erase(sample.begin());
cout <<
" Elements of multimap after deleting by position are : \n"
;
for
(
auto
& x : sample)
cout << x.first <<
" : "
<< x.second << endl;
sample.erase(
'c'
);
cout <<
" Elements of multimap after deleting by element name : \n"
;
for
(
auto
& x : sample)
cout << x.first <<
" : "
<< x.second << endl;
sample.erase(sample.find(
'e'
), sample.end());
cout <<
" Elements of multimap after deleting by range are : \n"
;
for
(
auto
& x : sample)
cout << x.first <<
" : "
<< x.second << endl;
return
0;
}