#include<algorithm>
#include<iostream>
using namespace std;
void print(int x)
{
cout<<x<<' ';
}
int main()
{
int iArray[]={,,-,,,,,,-,,};
const int len=sizeof(iArray)/sizeof(int);
cout<<"由小到时大排序"<<endl;
sort(iArray,iArray+len);
for_each(iArray,iArray+len,print);
cout<<endl;
cout<<"由大到小排序"<<endl;
sort(iArray,iArray+len,greater<int>());
for_each(iArray,iArray+len,print);
cout<<endl;
return ;
}

C++STL_sort的更多相关文章

随机推荐

  1. DOS命令行 定时关机&取消定时关机

      命令行关机命令----shutdown   Windows XP的关机是由Shutdown.exe程序来控制的,位于Windows\System32文件夹中.   如果你输入"shutd ...

  2. HttpApplication实战大文件上传 (第四篇)

    一.Asp.net中的文件上传 在Asp.net 1.1中,文件在上传过程中将被全部保存在内存中,对于大文件来说,会造成内存空间的过度使用,可能会招致恶意攻击.为了解决这个问题,Asp.net在配置文 ...

  3. python处理.seq文件

    # Deal with .seq format for video sequence # Author: Kaij # The .seq file is combined with images, # ...

  4. win7 奇怪的temp用户

    在C:\Users\TEMP 有个temp用户,win+r打开的也是 C:\Users\TEMP>,而不是C:\User\Administrator. 以下文章转自: http://hi.bai ...

  5. css案例学习之span边框实现的特殊效果

    bottom left bottom right top left top right 配合颜色来使用,实现一些神奇的效果 #menu a span{ height:; width:; /*borde ...

  6. Android性能优化典范【转】

    2015年伊始,Google发布了关于Android性能优化典范的专题,一共16个短视频,每个3-5分钟,帮助开发者创建更快更优秀的Android App.课程专题不仅仅介绍了Android系统中有关 ...

  7. UESTC_秋实大哥带我飞 2015 UESTC Training for Graph Theory<Problem B>

    B - 秋实大哥带我飞 Time Limit: 300/100MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others) Submit ...

  8. ZOJ 1008 Gnome Tetravex(DFS)

    Gnome Tetravex Time Limit: 10 Seconds      Memory Limit: 32768 KB Hart is engaged in playing an inte ...

  9. jsp定时方法

    jsp定时方法 $(function(){ totaladd(); //定时时触发的函数 setInterval(totaladd,);//设置定时1000=1秒 }); function total ...

  10. ajax+json+java

    1.首先下载json所以依赖的包, Json-lib 最新版 json-lib-2.3-jdk15.jar,其官方网站是:http://json-lib.sourceforge.net/可以直接dow ...