use sort function
in c++ how to use sort? i can show you
// step 1:
// make a vector
#include<bits/stdc++.h>
using namespace std;
int main(){
vector<int> a(4) = {3,4,2,1};
// step 2:
// use sort function
// if you need a[i]>a[i+1]
sort(a.begin(),a.end(),great<int>());
// if you need a[i]<a[i+1]
sort(a.begin(),a.end(),less<int>());
// if you need reverse
reverse(a.begin(),a.end());
}