From cb114b802c01df0aa7e45b1e54de333b1ea866c1 Mon Sep 17 00:00:00 2001 From: Yashi Tripathi <97374593+tripathiix@users.noreply.github.com> Date: Sat, 22 Oct 2022 09:39:06 +0530 Subject: [PATCH] update.cpp Update N elements in an array given array of elements and a corresponding array of positions. --- update.cpp | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 update.cpp diff --git a/update.cpp b/update.cpp new file mode 100644 index 0000000..991147d --- /dev/null +++ b/update.cpp @@ -0,0 +1,50 @@ +#include + +using namespace std; + +int main() +{ + int n; + cin>>n; + int arr[n]; + for(int i=0; i>arr[i]; + } + int m; + cin>>m; + int ele[m],pos[m]; + for(int i=0; i>ele[i]; + // cin>>pos[i]; + } + for(int i=0; i>pos[i]; + } + + for(int i=0; i