#include <iostream>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
using namespace std;
bool myfunction (int i,int j) { return (i>j); } // comparator
int main() {
srand(time(0));
int N;
cin >> N;
vector<int> A(N);
for(int i = 0; i<A.size(); ++i) {
A[i]=rand();
cout << A[i] << " ";
}
cout << endl;
sort(A.begin(), A.end(), myfunction);
system("pause");
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
using namespace std;
bool myfunction (int i,int j) { return (i>j); } // comparator
int main() {
srand(time(0));
int N;
cin >> N;
vector<int> A(N);
for(int i = 0; i<A.size(); ++i) {
A[i]=rand();
cout << A[i] << " ";
}
cout << endl;
sort(A.begin(), A.end(), myfunction);
for(int i = 0; i<A.size(); ++i) {
cout << A[i] << " ";
}
system("pause");
}