stl-3
来源:互联网 发布:吴恩达人工智能视频 编辑:程序博客网 时间:2024/04/29 01:31
/*const int i_red = 33;
const int i_blue = 16;
int i;
deque<int> d_red(i_red);
deque<int> d_blue(i_blue);
for(i=0;i<i_red;i++)
d_red[i] = i+1;
for(i=0;i<i_blue;i++)
d_blue[i] = i+1;
show_deque(d_red,"d_red");
//show_deque(d_blue,"d_blue");
for(i=0;i<100;i++)
random_shuffle(d_red.begin(),d_red.end());
show_deque(d_red,"d_red");
vector<int> v_red(6);
int idx = rand() % 32;
deque<int>::iterator itr = d_red.end() - idx;
for(int i=0; i<6; i++){
v_red[i] = *(itr++);
if(itr == d_red.end())
itr = d_red.begin();
}
show_vector(v_red,"the red ball is");
sort(v_red.begin(),v_red.end());
show_vector(v_red,"the sorted red ball is");*/
/*string s1;
getline(cin,s1);
cout<<s1;*/
//#using <mscorlib.dll> //托管代码 编译需要 /clr 控制
using namespace std;
//using namespace System;
//using namespace System::Collections;
template<class _Ty>void show_vector(vector<_Ty> vec,string sz);
template<class _Ty>void show_deque(deque<_Ty> d,string sz);
template<class _Ty>void show_valarray(valarray<_Ty> va, string sz);
template<class _Ty>void show_deque(deque<_Ty> d,string sz)
{
deque<_Ty>::iterator pit;
cout<<sz.c_str()<<": ";
for(pit=d.begin();pit!=d.end();pit++){
cout<<*pit<<" ";
}
cout<<endl;
}
template<class _Ty>void show_vector(vector<_Ty> vec,string sz)
{
vector<_Ty>::iterator it;
cout<<sz.c_str()<<": ";
for(it=vec.begin(); it!=vec.end(); it++)
{
cout<<*it<<" ";
}
cout<<endl;
}
template<class _Ty>void show_valarray(valarray<_Ty> va, string sz)
{
cout<<sz.c_str()<<": ";
for(int i=0; i<(int)va.size(); i++){
cout<<va[i]<<" ";
}
cout/*<<"/nsize:"<<(unsigned int)va.size()*/<<endl;
}
- stl-3
- STL #3
- STL 3: STL的六大组件
- STL基础3:STL一些概念详解
- STL源码剖析(3)
- Effective STL 读书笔记 3
- STL实践指南(3)
- stl学习笔记3
- STL杂记(3)
- STL实践指南(3)
- STL--string用法(3)
- STL(3) find_if函数
- STL常用算法3
- stl操作3
- STL算法------查找3
- 卡片游戏3-STL
- Effective STL 条款3
- STL(3)---<vector>
- IT 治理的目标
- 工作伊始,一点感受
- Microsoft Windows Wkssvc NetrJoinDomain2 Stack Overflow(MS06-070) Exploit
- OleDbCommand执行查询无效的解决
- 使用log4j为Tomcat输出日志
- stl-3
- yulong通讯笔试总结(3)
- 停止词(stop words)
- objectarx.net自动加载问题
- 协同软件
- 在VS 2005中使用TREEVIEW控件
- 四川省财政厅借IT治理实践Cobit模型实现科学运维管理
- 身体状况大不如从前
- 为了自己的心身健康 合理安排生活 特做了张时间安排表