From c0974d3107ffc7cba16f93518b9bece3747d2e69 Mon Sep 17 00:00:00 2001 From: takkarparas <41841853+takkarparas@users.noreply.github.com> Date: Fri, 30 Oct 2020 22:39:57 +0530 Subject: [PATCH] Create evenarray.cpp --- Algorithm/evenarray.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Algorithm/evenarray.cpp diff --git a/Algorithm/evenarray.cpp b/Algorithm/evenarray.cpp new file mode 100644 index 0000000..2344db5 --- /dev/null +++ b/Algorithm/evenarray.cpp @@ -0,0 +1,27 @@ +#include +#include +using namespace std; +int t,s,e,i; +vectorv; +int main() +{ cin>>t; + while(t--) + { + int a=0; + int b=0; + cin>>s; + for(i=0;i>e; + + if((e%2)==0&(i%2)!=0) + {a+=1;} + if((e%2)!=0&(i%2)==0) + {b+=1;} + } + if(a==b) + {cout<