#include <iostream>
#include <vector>
#include <algorithm> // for sort
int main()
{
int x[10] = { 1,3,5,7,9,2,4,6,8,10 };
std::vector<int> vec(x, x+10); // construct std::vector object
std::sort(vec.rbegin(),vec.rend()); // sort it in reverse manner
for(int i = 0; i < 10; ++i)
std::cout << vec[i] << " ";
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8YWxnb3JpdGhtPiAgICAvLyBmb3Igc29ydAoKaW50IG1haW4oKQp7CiAgICBpbnQgeFsxMF0gPSB7IDEsMyw1LDcsOSwyLDQsNiw4LDEwIH07CiAgICBzdGQ6OnZlY3RvcjxpbnQ+IHZlYyh4LCB4KzEwKTsgICAgICAgICAgLy8gY29uc3RydWN0IHN0ZDo6dmVjdG9yIG9iamVjdAogICAgc3RkOjpzb3J0KHZlYy5yYmVnaW4oKSx2ZWMucmVuZCgpKTsgICAgIC8vIHNvcnQgaXQgaW4gcmV2ZXJzZSBtYW5uZXIKICAgIGZvcihpbnQgaSA9IDA7IGkgPCAxMDsgKytpKQogICAgICAgIHN0ZDo6Y291dCA8PCB2ZWNbaV0gPDwgIiAiOwp9Cg==