相关文章推荐
愤怒的大蒜  ·  AI for ...·  2 月前    · 
精明的针织衫  ·  乐山市民政局·  5 月前    · 

Map<int, string> mapStudent;

mapStudent.insert(pair<int, string>(1, “student_one”));

mapStudent.insert(pair<int, string>(2, “student_two”));

mapStudent.insert(pair<int, string>(3, “student_three”));

map<int, string>::iterator iter;

iter = mapStudent.find(1);

if(iter != mapStudent.end())

Cout<<”Find, the value is ”<<iter->second<<endl;

Cout<<”Do not Find”<<endl;