博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
关于集合set ---STL
阅读量:4682 次
发布时间:2019-06-09

本文共 347 字,大约阅读时间需要 1 分钟。

关于集合set的去重复,向集合中插入元素

#include<iostream>

#include<set>
using namespace std;
int main()
{
set<int>myset;
int num;
for(int i=0;i<6;i++)
{
cin>>num;
myset.insert(num);
}
//for(int i=0;i<myset.size();i++)
set<int>::iterator te=myset.begin();
while(te!=myset.end())
{
cout<<*te<<" ";
te++;
}
return 0;
}

转载于:https://www.cnblogs.com/zdblog/p/3675267.html

你可能感兴趣的文章
Centos 6.5下的OPENJDK卸载和SUN的JDK安装、环境变量配置
查看>>
poj 1979 Red and Black(dfs)
查看>>
【.Net基础03】HttpWebRequest模拟浏览器登陆
查看>>
UML-画类图与交互图的顺序
查看>>
杭电1060
查看>>
webdriver test1
查看>>
RFC端口号定义
查看>>
Unity Technologies-提供全面的技术支持服务
查看>>
Console-算法[for,if,break]-五个好朋友分苹果
查看>>
ylb: SQL表的高级查询-子查询
查看>>
import 用法
查看>>
6月7 考试系统
查看>>
mysql 基本操作
查看>>
HTML5 and Websocket
查看>>
zTree async 动态参数处理
查看>>
Oracle学习之常见错误整理
查看>>
Android实例-处理隐藏输入法后不再显示问题(XE8+小米2)
查看>>
字符串反转(10)
查看>>
HTC Sensation G14开盒
查看>>
Buffer cache spillover: only buffers
查看>>