STL基本知识vector
来源:互联网 发布:天龙八部 知乎 编辑:程序博客网 时间:2024/04/26 11:26
#include
#include
#include
using namespace std;
void output(int &s) //输出函数
{
cout<<s<<endl;
}
bool mycomp(const int &s1,const int &s2)
{
return s1>s2;
}
int main(int argc,char * argv[])
{
vector myvt;
myvt.insert(myvt.begin(),2);
myvt.insert(myvt.begin()+1,4);
myvt.insert(myvt.end(),1);
cout<<"原顺序 :"< for_each(myvt.begin(),myvt.end(),output);
cout<<"升序:"< sort(myvt.begin(),myvt.end()); //默认升序排列
for_each(myvt.begin(),myvt.end(),output);
cout<<"降序:"< sort(myvt.begin(),myvt.end(),mycomp);
for_each(myvt.begin(),myvt.end(),output);
}
- STL基本知识vector
- STL vector
- STL vector
- stl vector
- STL vector
- STL vector
- stl-vector
- STL--vector
- STL Vector
- stl vector
- STL:vector
- STL---vector
- STL-vector
- Stl--Vector
- Stl--Vector
- STL Vector
- STL vector
- stl vector
- div漂浮在flash上面
- 全球最大网页游戏公司Bigpoint进军美国
- Design pattern----Facade Pattern
- [news]zynamics acquired by Google !
- mysql 5注入中group_concat的使用
- STL基本知识vector
- 美国信息交换标准代码
- duck duck go VS Google
- VC ADO技术简介
- 无言的情怀
- 一类最短距离问题
- aspnetpager使用方法
- C#中MessageBox用法大全
- 班级30人留学或保送的背后