#include <iostream>
#include <algorithm>
#include <cassert>
#include <functional>
using namespace std;
int main() {
int a[100];
int i;
for (i = 0; i < 100; ++i)
a[i] = i;
random_shuffle(&a[0], &a[100]);
for (i = 0; i < 100; ++i)
cout << a[i] << " ";
cout <<"\n\n\n\n";
// Sort into descending order:
sort(&a[0], &a[100], greater<int>());
for (i = 0; i < 100; ++i)
cout << a[i] << " ";
return 0;
}
|