练习题 No.17 set容器
来源:互联网 发布:黄金储备数据 编辑:程序博客网 时间:2024/06/06 03:13
要求
set容器是用二叉搜索书进行维护集合的容器。
限制条件
无
输入格式
无
输出格式
无
测试输入
无
测试输出
无
解题思路
还有可以重复的multiset
代码
#include <iostream>#include <set>using namespace std; int main() { set<int> s; // 插入元素 s.insert(1); s.insert(3); s.insert(5); set<int>::iterator it; // 查找元素 it = s.find(1); if (it == s.end()) { cout << "No found" << endl; } else { cout << *it << endl; } // 删除 s.erase(3); // 查找元素 cout << s.count(3) << endl; for (it = s.begin(); it != s.end(); it++) { cout << *it << endl; } return 0; }
0 0
- 练习题 No.17 set容器
- 练习题 No.18 map容器
- zzuli oj 1871: NO offer <set容器的用法>
- 每日一题 No.27 set容器的学习
- set容器
- set容器
- set容器
- 容器set
- set容器
- 容器set
- set 容器
- Set容器
- 容器Set
- set容器
- set 容器
- set容器
- set容器
- set容器
- angularjs ng-click无效的可能原因
- 超详细mysql left join,right join,inner join用法分析
- 二维计算几何模板
- 最基础的python抓取网站图片例子
- HDU2004 成绩转换
- 练习题 No.17 set容器
- Oracle查询中如何去除查询的重复数据
- FFmpeg在Linux下安装编译过程
- mysql统计字段相同值数量
- React Native -- mobx
- Unity实现卷纸浏览效果
- dede所有目录模板全解
- 继续SDRAM+UART调试
- Linux 下的tomcat下载,安装和配置