diff --git a/sorting_a_vector.cpp b/sorting_a_vector.cpp new file mode 100644 index 00000000..39eba6a8 --- /dev/null +++ b/sorting_a_vector.cpp @@ -0,0 +1,40 @@ +#include +#include +#include +#include +using namespace std; + +bool compare(int a,int b){ + return a>b; +} + +int main(){ + + vector v; + + for(int i=1;i<5;i++){ + v.push_back(i); + } + int p; + cin>>p; + + int d; + cin>>d; + + v.insert(v.begin() + p,d); + + for(int i=0;i