STL Container6: Set
来源:互联网 发布:相贯线切割机编程 编辑:程序博客网 时间:2024/06/07 00:13
// Set_Process.cpp : Defines the entry point for the console application.
//
#include <iostream>
using std::cout;
using std::endl;
#include <set>
#include <iterator>
typedef std::set< double, std::less< double > > double_set;
int _tmain(int argc, _TCHAR* argv[])
{
const int SIZE = 5;
double a[ SIZE ] = { 2.1, 4.2, 9.5, 2.1, 3.7 };
double_set doubleSet( a, a + SIZE );
std::ostream_iterator< double > outputIt( cout, " " );
cout<<"double Set contains: ";
std::copy( doubleSet.begin(), doubleSet.end(), outputIt );
std::pair< double_set::const_iterator, bool > p;
p = doubleSet.insert( 13.8 );
cout<< "/n/n" << *(p.first)
<< ( p.second ? " was": " was not") << " inserted";
cout<<"/ndoubleSet contains: ";
std::copy( doubleSet.begin(), doubleSet.end(), outputIt );
p = doubleSet.insert( 9.5 );
cout<<"/n/n" << *( p.first )
<< ( p.second ? " was" : " was not" ) << " inserted";
cout<< "/ndoubleSet contains: ";
std::copy( doubleSet.begin(), doubleSet.end(), outputIt );
cout<<endl;
return 0;
}
- STL Container6: 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
- stl-set
- STL set
- STL-set
- set--STL
- STL set
- keelkit数据库连接字符串的设置
- CvSize结构
- Internet 服务总线
- View & DML
- 软件设计师完美通过
- STL Container6: Set
- Ubuntu关于复制粘帖的技巧
- STL Container7: muiltiset
- 六级考试
- 领带的10种打法
- ssh2整合OA问题集
- Sqlserver2005优化查询速度51法
- 个人代码库管理website
- java培训资料第一部分资料已经上传