码迷,mamicode.com
首页 > 其他好文 > 详细

set的用法

时间:2018-06-08 14:27:47      阅读:110      评论:0      收藏:0      [点我收藏+]

标签:alt   str   com   ret   http   out   用法   ISE   iterator   

 1 #include<iostream>
 2 #include<set>
 3 using namespace std;
 4 
 5 int main()
 6 {
 7     set<int> iset = { 2, 5, 6, 3, 9, 5, 2 };   //按照关键字排序
 8     set<int>::const_iterator set_it = iset.begin();
 9     for (; set_it != iset.end(); ++set_it)
10         cout << *set_it << " ";
11     cout << endl;
12     return 0;
13 }

输出结果:

技术分享图片

 

set的用法

标签:alt   str   com   ret   http   out   用法   ISE   iterator   

原文地址:https://www.cnblogs.com/sunbines/p/9155002.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!