stl set 排序
来源:互联网 发布:网页游戏发布平台源码 编辑:程序博客网 时间:2024/05/23 14:43
#include<iostream>#include<set>using namespace std;struct row{int num;string str;};struct classcmp{ bool operator()(const row& lhs, const row& rhs) { return lhs.num < rhs.num; }};struct classcmp1{ bool operator()(const int& lhs, const int& rhs) { return lhs < rhs ; }};int main(void){set<row, classcmp> s5 ;row a,b,c;a.num = 1;b.num = 2;c.num = 3;s5.insert(a);s5.insert(b);s5.insert(c);cout<<"over"<<endl;set<row>::iterator it;for(it = s5.begin(); it != s5.end(); it++){cout<<(*it).num<<endl;}//system("pause") ;return 0;}
参考:
http://www.cnblogs.com/graphics/archive/2010/06/01/1749569.html
0 0
- STL SET 类 排序
- STL set 默认排序
- stl set 排序
- STL之Set自定义排序
- 01串排序(stl set使用)
- c++ stl set之顺序排序。
- 一种排序STL在set中的结构体排序
- STL set
- STL SET
- STL set
- stl set
- STL set
- STL----set
- STL set
- stl set
- STL set
- stl set
- STL set
- “对路APP ”新版首推领投+跟投模式 或领中国合投新潮
- MySQL事务隔离级别
- IOS-6-UI知识总结-1(代码添加控件、视图切换、多种传值方式)
- 推荐!国外程序员整理的Java资源大全
- 怎么引客流量???
- stl set 排序
- js-闭包原理
- 开源框架文章收藏
- 5、教你透彻了解红黑树
- 【POJ 2031】 Building a Space Station (三维坐标求距离+最小生成树)
- javah 错误: 找不到 'XXX' 的类文件。
- 使用springMVC的详细步骤
- StringBuffer应用
- ARC之解决对象之间的循环强引用(Swift)