曾经不了解的set的知识
2016-04-26 21:59
176 查看
5.元素检索:find(),若找到,返回该键值迭代器的位置,否则,返回最后一个元素后面一个位置。
set<int> s;
set<int>::iterator it;
it=s.find(5); //查找键值为5的元素
if(it!=s.end()) //找到
cout<<*it<<endl;
else //未找到
cout<<"未找到";
C++ iterator 迭代器
Such as
Set<int>p;
set<int>iterator it;
则 。。。。
It=p.begin();
…
set<int> s;
set<int>::iterator it;
it=s.find(5); //查找键值为5的元素
if(it!=s.end()) //找到
cout<<*it<<endl;
else //未找到
cout<<"未找到";
C++ iterator 迭代器
Such as
Set<int>p;
set<int>iterator it;
则 。。。。
It=p.begin();
…
相关文章推荐
- java-map-EnumMap
- 第一冲刺阶段工作总结06
- 学生成绩录入系统设计与实现
- opencv fatal error:模块计算机类型“X86”与目标计算机类型“x64”冲突
- leetcode——145——Binary Tree Postorder Traversal
- Android 开源框架Universal-Image-Loader完全解析(二)--- 图片缓存策略详解
- 批处理
- 作业6成绩录入系统设计阶段一
- OpenCV2.4.10之samples_cpp_tutorial-code_learn-----ImgTrans(Hough变换)
- 绘制恒星行星卫星三星系统
- Canvas HTML5
- Hibernate开篇(一)
- POJ-1845 Sumdiv
- 用小猫统计制作运动员评价管理系统:导入下拉列表内容(固定值列表)
- 如何清理Xcode缓存
- C++作业4
- 单调队列
- c++第四次实验
- Dart异步与消息循环机制
- JavaScript