# Include <iostream>
# Include <map>
# Include <string>
Using namespace STD;
Int main (){
String Xingming;
String Shuming;
Multimap <string, string> mm;
While (CIN> Xingming> Shuming ){
Mm. insert (make_pair (Xingming, Shuming ));
Cin. Clear ();
}
String name;
Cout <"Enter the author you want to find" <Endl;
Cin. Clear ();
Cin> name;
Multimap <string, string >:: iterator iter = mm. Find (name );
Int T = mm. Count (name );
For (INT I = 0; I! = T; ++ I, ++ ITER ){
Cout <ITER-> second <Endl;
}
For (multimap <string, string >:: iterator II = mm. Begin (); II! = Mm. End (); ++ II ){
Cout <(* II). Second <"";
}
Cout <Endl;
System ("pause ");
Return 0;
}
# Include <iostream>
# Include <string>
# Include <map>
Using namespace STD;
Int main (){
String Xingming;
String Shuming;
Multimap <string, string> mm;
While (CIN> Xingming> Shuming ){
Mm. insert (make_pair (Xingming, Shuming ));
Cin. Clear ();
}
Cin. Clear ();
Cout <"The author you want to delete" <Endl;
Cin> Xingming;
// Pair <multimap <string, string >:: iterator, multimap <string, string >:: iterator> PMI = mm. pai_range (Xingming );
// Mm. Erase (PMI. First, PMI. Second );
Multimap <string, string >:: iterator beg = mm. lower_bound (Xingming );
Multimap <string, string >:: iterator end = mm. upper_bound (Xingming );
Mm. Erase (beg, end );
For (multimap <string, string >:: iterator IIi = mm. Begin (); III! = Mm. End (); ++ III ){
Cout <III-> first <"" <III-> second <Endl;
}
Cout <Endl;
System ("pause ");
Return 0;
}