STL之<set>
来源:互联网 发布:python爬虫识别验证码 编辑:程序博客网 时间:2024/04/30 06:06
Set用于存储不重复的元素,若重复存入同一元素,则set会将其覆盖掉。#include <iostream>#include <set>using namespace std;set <int> h;//这个地方的int可以换为任意你想储存元素的类型int main() { int n, x; cin >> n;
h.clear();//这条语句的目的是清理h; for(int i = 0; i < n; i++) { cin >> x; h.insert(x); } set <int>::iterator it; for(it = h.begin(); it != h.end(); it++) cout << (*it) << endl; if(h.find(3) != h.end()) cout << "Yes, 3 is in set h" << endl; else cout << "No, element does not exist" << endl; return 0;}
- 【STL】STL之set
- stl之set
- STL 应用之set
- STL容器之set
- STL之<set>
- STL之set
- STL之set
- C++ STL之set
- C++ STL 之set
- STL 之 set 集合
- STL之set
- STL 之set 练习
- stl 之set图解
- STL之set姿势
- STL 之 set
- stl之set
- stl之hash set
- STL具体操作之set
- Tomcat中部署.war
- CentOS下NFS安装与配置 Centos 6.2下安装配置NFS
- powerdesigner 12.0 带数据修改表结构
- 【转】构建 ogre1.6 + cegui0.7.1 + CELayoutEditor-0.7.1
- 数据类型 uint8_t uint16_t uint32_t uint64_t
- STL之<set>
- C#重写WebBrowser组件,禁止跳转到IE新窗口、脚本错误 (转载)
- 《牛2》结局
- Oracle错误代码一览表,方便大家查询!
- 打开网页
- 暑假集训半个月了
- property_get/property_set
- 微软面试、经典算法、编程艺术、红黑树4大系列总结
- 用js实现对图片的局部放大