复习。主要是考场上要用迭代器的时候突然忘了。我是傻逼。放个板子以防以后忘了。
map<int,int>a; a[3]=3; a[2]=2; a[1]=1; a[100]=1; map<int,int>::iterator it=a.begin(); while(it!=a.end()){ if(it->first>100)break; printf("%d %d\n",it->first,it->second); it++; }