#include <iostream>
#include <map>
using namespace std;
// 错误写法 map <int no, string name> m;
map <int, string> m;
int main() {
// 插入数据
m[20153463] = "bijingrui";
m[1000] = "admin";
m.insert(pair<int,string> (20160101,"liu"));
// 读取数据
cout << m[20160101] << endl;
cout << m.at(1000) << endl;
// m的信息
cout << m.empty() << endl;
cout << m.size() << endl;
// 删除信息
m.erase(1000);
cout << m.size() << endl;
cout << " *** " << endl;
map<int, string>::iterator it;
for (it = m.begin();it != m.end();it++) {
cout << it->first << " ";
cout << it->second << endl;
}
it = m.find(9999);
if (it == m.end()){
cout << "查无此人" << endl;
}else {
cout << it->first << " " << it->second << endl;
}
// m.insert();
// m.erase();
}