C++ map??????????????
???????????? ???????[ 2014/1/28 9:12:11 ] ????????c++ ???? map
????6.map??sort????
????Map?е???????????key????????????????map??sort??????
????For example??
#include <map>
#include <iostream>
using namespace std;
int main( )
{
map <int?? int> m1;
map <int?? int>::iterator m1_Iter;
m1.insert ( pair <int?? int> ( 1?? 20 ) );
m1.insert ( pair <int?? int> ( 4?? 40 ) );
m1.insert ( pair <int?? int> ( 3?? 60 ) );
m1.insert ( pair <int?? int> ( 2?? 50 ) );
m1.insert ( pair <int?? int> ( 6?? 40 ) );
m1.insert ( pair <int?? int> ( 7?? 30 ) );
cout << "The original map m1 is:"<<endl;
for ( m1_Iter = m1.begin( ); m1_Iter != m1.end( ); m1_Iter++ )
cout << m1_Iter->first<<" "<<m1_Iter->second<<endl;
}
The original map m1 is:
1 20
2 50
3 60
4 40
6 40
7 30
???????????????. . .
????7?? map???????????????
????C++ Maps???????????????????“?????/?”??
begin() ???????map??????????
clear(?? ??????????
count() ?????????????????
empty() ???map???????true
end() ???????map?β???????
equal_range() ????????????????????
erase() ?????????
find() ??????????
get_allocator() ????map????????
insert() ???????
key_comp() ?????????key?????
lower_bound() ??????>=????????????λ??
max_size() ???????????????????
rbegin() ??????????mapβ?????????????
rend() ??????????map??????????????
size() ????map?????????
swap() ????????map
upper_bound() ??????>????????????λ??
value_comp() ?????????value?????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11