map find
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <map>
using namespace std;
int main( )
{
map<int,string>mp;
mp[0] = "beijing";
mp[1] = "shanghai";
mp[2] = "shenzhen";
map<int,string>::iterator iter;
iter = mp.find(1);
if( iter != mp.end( ) )
cout<<iter->second<<endl;
else
cout<<"NOT FOUNDING"<<endl;
return 0;
}
posted on 2011-07-28 21:59 more think, more gains 阅读(147) 评论(0) 收藏 举报
浙公网安备 33010602011771号