====== std_lib_study ====== ===== - map ===== ==== - find ==== #include #include using namespace std; int main() { /* map.find(key)返回键为key的映射的迭代器 */ map mp; mp['m'] = 20; mp['r'] = 30; mp['a'] = 40; map::iterator it = mp.find('a'); if (it !=mp.end()){ printf("%c %d\n", it->first,it->second); // 只有map迭代器可以使用first/second方式 } else { printf("没找到\n"); } return 0; } ==== - map用法 ==== https://blog.csdn.net/jinghuashuiyuedi/article/details/54347844