STL练习排序sort函数
2014-04-04 15:26
267 查看
#include <iostream>
#include <algorithm>
#include <numeric>
#include <functional>
#include <vector>
using namespace std;
int main()
{
vector<int>vecIntA;
vecIntA.push_back(6);
vecIntA.push_back(3);
vecIntA.push_back(1);
vecIntA.push_back(9);
vecIntA.push_back(4);
sort(vecIntA.begin(),vecIntA.end());
for(size_t i=0;i<vecIntA.size();i++)
{
cout<<vecIntA[i]<<" ";
}
cin.get();
return 0;
}
#include <algorithm>
#include <numeric>
#include <functional>
#include <vector>
using namespace std;
int main()
{
vector<int>vecIntA;
vecIntA.push_back(6);
vecIntA.push_back(3);
vecIntA.push_back(1);
vecIntA.push_back(9);
vecIntA.push_back(4);
sort(vecIntA.begin(),vecIntA.end());
for(size_t i=0;i<vecIntA.size();i++)
{
cout<<vecIntA[i]<<" ";
}
cin.get();
return 0;
}
相关文章推荐
- Linux驱动程序学习备忘之六
- 【SDOI2012】Longge的问题
- 一步步学习数据结构和算法之归并排序效率分析及java实现
- 锲而不舍
- Windows Server 2008R2中的密码策略
- Poco 配置文件读取
- $(EngineRoot) 在哪里呢???
- 虚拟机图形化使用
- Poco 配置文件读取
- linux下乱码问题总结
- Java多线程断点续传下载
- Merge Two Sorted Lists
- js根据按键传值跳转页面
- Sql注入漏洞及绑定变量浅谈
- 部署 PHP 系列,第 3 部分: 加速用于 Oracle 的 PHP 代码运行速度
- Flex 1152:继承的定义在(命名空间public。。)存在冲突
- ubuntu 12.04 64 install beyond compare
- C++中引用和指针的区别
- STL练习合并merge函数
- ViewPager onPageChangeListener总结