#include<iostream>
#include<string>
#include<map>
using namespace std;
int main()
{
multimap<string,int> m_map;
string s("中国"),s1("美国");
m_map.insert(make_pair(s,50));
m_map.insert(make_pair(s1,30));
m_map.insert(make_pair(s,55));
m_map.insert(make_pair(s,60));
m_map.insert(make_pair(s1,20));
m_map.insert(make_pair(s1,10));
cout << "方式1>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << endl;
multimap<string, int>::iterator it = m_map.find(s); int iCnt = m_map.count(s);
for(int i = 0; i < iCnt; i++, it++){
cout << it->first << " : " << it->second << endl;
}
cout << ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << endl << endl;
cout << "方式2>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << endl;
for(multimap<string, int>::iterator it = m_map.lower_bound(s1); it != m_map.upper_bound(s1); it++){
cout << it->first << " : " << it->second << endl;
}
cout << ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << endl << endl;
cout << "方式3>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << endl;
for(multimap<string, int>::iterator it = m_map.equal_range(s).first; it != m_map.equal_range(s).second; it++){
cout << it->first << " : " << it->second << endl;
}
cout << ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << endl << endl;
return 0;
}