16 lines
291 B
C++
16 lines
291 B
C++
|
#include <iostream>
|
||
|
#include <map>
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
map<int, string> m;
|
||
|
m.insert(make_pair(1, "disen"));
|
||
|
m.insert(make_pair(2, "lucy"));
|
||
|
cout << m.size() << endl;
|
||
|
m.erase(1); // 删除键值为 1 的元素
|
||
|
cout << m.size() << endl;
|
||
|
return 0;
|
||
|
}
|