Responsive Ads Here

Wednesday 10 May 2017

STRHH - Half of the half

problem id:-http://www.spoj.com/problems/STRHH/

code:-

#include <iostream>
using namespace std;

int main() {
int t;
cin>>t;
while(t--)
{
string str;
cin>>str;
int i=str.length()/2,j=0;
while(j<i)
{
cout<<str[j];
j+=2;
}
cout<<'\n';
}

return 0;
}

No comments:

Post a Comment