set集中查找find
2016-03-03 21:11
267 查看
#include <iostream> #include <set> using namespace std; typedef set<int> SETINT; // SETINT是别名, int main() { SETINT a; a.insert(67); a.insert(7); a.insert(-2); SETINT::const_iterator i; for (i = a.begin(); i != a.end(); ++i) { cout << *i << endl; } SETINT::iterator i_found = a.find(70); if (i_found != a.end()) cout << "找到了," << *i_found << endl; else cout << "没有找到," << endl; return 0; }
相关文章推荐
- PAT-1082. Read Number in Chinese (25)(模拟)
- Web开发学习之路--Eclipse+Tomcat+mysql之初体验
- C辗转相除法求最大公约数的实现
- BootStrap详解之(一)
- DSP 2812: 使用C++封装中断控制器PIE
- Android Studio 1.3及以上 NDK环境配置
- hdu 1272 小希的迷宫 解题报告
- PAT-A1077. Kuchiguse (20)(模拟)
- 第一次写博客
- SQL Server 2008 R2 完全卸载与重新安装
- xib自定义UIView报错误 "forUndefinedKey:]: this class is not key value coding-compliant for the key"
- hiho Hamiltonian Cycle
- Android Fragment 基础初识(下)
- C指针作为函数参数引用
- Navicat for MySQL用ssh功能连接远程数据库
- cocos2dx 基础
- Android学习之接口Interface
- Codeforences #309 C(div2)
- base.superclass.constructor.call(this,config)
- 在虚拟主机下的实用curl 本地127.0.0.1 以及301问题