1.bool operator()(para...)
2.sort(para1,para2,para3)
#include<iostream>
#include<algorithm>
using namespace std;
class Comp
{
bool flag;
public:
Comp():flag(true){}
Comp(bool in_flag):flag(in_flag){}
bool operator()(const int &a,const int &b)
{
if(flag) return a>b;
return a<b;
}
};
int main(int argc,char **argv)
{
int const SIZE=100;
int *a=new int[SIZE];
int *b=a;
while(cin>>*b)
{
++b;
}
sort(a,b,Comp());
for(int *c=a;c!=b;++c)
{
cout<<*c<<' ';
}
cout<<endl;
sort(a,b,Comp(false));
for(int *c=a;c!=b;++c)
{
cout<<*c<<' ';
}
cout<<endl;
}