#include <iostream>
#include <set>
#include <iterator>
using namespace std;
int main ()
{
int ary[] = { 5,3,7,5,2,3,7,5,5,4 };
set<int> s1;
set<int, greater<int> > s2;
for ( int i=0; i<sizeof(ary)/sizeof(int); i++ )
{
s1.insert(ary[i]);
s2.insert(ary[i]);
}
set<int>::iterator It = s1.begin();
set<int,greater<int>>::iterator It2 = s2.begin();
cout << "s1 : ";
while ( It != s1.end() )
cout << *(It++) << " ";
cout << endl;
cout << "s2 : ";
while ( It2 != s2.end() )
cout << *(It++) << " ";
cout << endl;
set<int> s3(ary,ary+3);
It = s3.begin();
cout << "s3 : ";
while ( It != s3.end() )
cout << *(It++) << " ";
cout << endl;
set<int, less > s4(s1);
It = s4.begin();
cout << "s4 : ";
while ( It != s4.end() )
cout << *(It++) << " ";
cout << endl;
getchar();
return 0;
}