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;voidseprateString(stringS){for(inti=0;i<S.length();i++){if(i%2==0){cout<<S[i];}}cout<<" ";for(intj=0;j<S.length();j++){if(j%2!=0){cout<<S[j];}}cout<<endl;}intmain(){/* Enter your code here. Read input from STDIN. Print output to STDOUT */intT;cin>>T;for(inti=0;i<T;i++){stringS;cin>>S;seprateString(S);}return0;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 6: Let's Review
You are viewing a single comment's thread. Return to all comments →
Simple C++ Solution :)