#include <bits/stdc++.h>
using
namespace
std;
void
print(multimap<tuple<string,
int
,
float
>,
bool
>& myContainer)
{
cout <<
"Key(tuple of integers)"
<<
" "
<<
"Value(boolean)\n\n"
;
for
(
auto
currentTuple : myContainer)
{
tuple<string,
int
,
float
> Key =
currentTuple.first;
bool
value = currentTuple.second;
cout <<
'['
<< get<0>(Key) <<
" , "
<<
get<1>(Key) <<
" , "
<< get<2>(Key) <<
']'
<<
" "
<<
value <<
'\n'
;
}
}
int
main()
{
multimap<tuple<string,
int
,
float
>,
bool
> myContainer;
tuple<string,
int
,
float
> tuple1;
tuple1 = make_tuple(
"Java"
, 100, 1.123);
tuple<string,
int
,
float
> tuple2;
tuple2 = make_tuple(
"Geek"
, 200, 2.123);
tuple<string,
int
,
float
> tuple3;
tuple3 = make_tuple(
"HTML"
, 300, 3.123);
tuple<string,
int
,
float
> tuple4;
tuple4 = make_tuple(
"Java"
, 100, 1.123);
myContainer.insert(pair<tuple<string,
int
,
float
>,
bool
>(tuple1,
true
));
myContainer.insert(pair<tuple<string,
int
,
float
>,
bool
>(tuple2,
false
));
myContainer.insert(pair<tuple<string,
int
,
float
>,
bool
>(tuple3,
true
));
myContainer.insert(pair<tuple<string,
int
,
float
>,
bool
>(tuple4,
false
));
print(myContainer);
return
0;
}