From 5ed96203ed9cdb936df7436a61fe616e54526b69 Mon Sep 17 00:00:00 2001 From: Vicky <107568580+HungryVicky@users.noreply.github.com> Date: Mon, 3 Oct 2022 11:10:30 +0530 Subject: [PATCH] Create Vector-Erase.cpp --- algorithms/CPlusPlus/Sorting/Vector-Erase.cpp | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 algorithms/CPlusPlus/Sorting/Vector-Erase.cpp diff --git a/algorithms/CPlusPlus/Sorting/Vector-Erase.cpp b/algorithms/CPlusPlus/Sorting/Vector-Erase.cpp new file mode 100644 index 00000000..bbdbf42b --- /dev/null +++ b/algorithms/CPlusPlus/Sorting/Vector-Erase.cpp @@ -0,0 +1,28 @@ +#include +#include +#include +#include +#include +using namespace std; + + +int main() { + int size,pos,start,end,n,i,a,j; + cin>>n; + vectorv; + for(i=0;i>a; + v.push_back(a); + } + cin>>pos>>start>>end; + v.erase(v.begin()+(pos-1)); + v.erase(v.begin()+start-1,v.begin()+end-1); + size=v.size(); + cout<