#include <algorithm>
#include <vector>
#include <functional>
bool my_greater(int& a, int& b)
{
return a > b;
}
int main(int argc, char** argv)
{
std::vector<int> vec;
vec.push_back(5);
vec.push_back(3);
vec.push_back(4);
vec.push_back(1);
vec.push_back(2);
vec.push_back(0);
for (auto &i : vec)
{
printf("%d,", i);
}
puts("");
std::sort(vec.begin(), vec.end());
for (auto& i : vec)
{
printf("%d,", i);
}
puts("");
std::sort(vec.begin(), vec.end(), std::greater<int>());
for (auto& i : vec)
{
printf("%d,", i);
}
puts("");
std::sort(vec.begin(), vec.end(), std::less<int>());
for (auto& i : vec)
{
printf("%d,", i);
}
puts("");
std::sort(vec.begin(), vec.end(), my_greater);
for (auto& i : vec)
{
printf("%d,", i);
}
puts("");
auto fun = [](int& a, int& b){ return a < b; };
std::sort(vec.begin(), vec.end(), fun);
for (auto& i : vec)
{
printf("%d,", i);
}
puts("");
std::sort(vec.begin(), vec.end(), [](int& a, int& b){ return a > b; });
for (auto& i : vec)
{
printf("%d,", i);
}
puts("");
getchar();
return 0;
}