We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
#include<cmath>#include<cstdio>#include<vector>#include<iostream>#include<algorithm>usingnamespacestd;intmain(){/* Enter your code here. Read input from STDIN. Print output to STDOUT */inttest_case;// number of test cases cin>>test_case;for(inti=0;i<test_case;i++){stringS;cin>>S;// input the stringsstringeven="",odd="";// storage of seperationfor(intj=0;j<S.length();j++){if(j%2==0){even+=S[j];// to append}else{odd+=S[j];}}cout<<even<<" "<<odd<<endl;}return0;}
Day 6: Let's Review
You are viewing a single comment's thread. Return to all comments →
my c++ solution, sorry if its a mess