My solution of 'half of the half' is being rejected by SPOJ, even though it gives a correct solution on my laptop.
here is the code:
using namespace std;
int main() {
char a[100];
int t,j,i,l;
scanf("%d",&t);
while(t--)
{ gets(a);
l=strlen(a);
for(j=0;j<(l/2);)
{ printf("%c",a[j]);
j=j+2;
}
printf("\n");
}
return 0;
}
Can anybody please help me with the code.