I have tried many inputs for my code and it works perfectly on my machine but gives wrong answer in Codechef judge.I have read the forum too and tried every corner case suggested by others.Please Help me.
My Code is:
#include<stdio.h>
#include<stdlib.h>
int num(unsigned long x);
int main()
{
unsigned long t;
scanf("%lu",&t);
while(t--)
{
unsigned long k,m;
int sum=0,i,s,j,n;
char a[10];
scanf("%lu",&k);
jump:
k=k+1;
if(k>9)
{
while(sum==0)
{sum=1;
n=num(k);
sprintf(a,"%lu",k);
for(j=0;j<=n/2;j++)
{
if(a[j]==a[n-1-j])
{
s=1;
}
else
s=0;
sum=sum*s;
if(sum==0)
goto jump;
}
if(sum==1 && k>9)
printf("%lu\n",k);
}
}
else
goto jump;
}
return 0;
}
int num(unsigned long k)
{ int i=0;
while(k!=0)
{
k=k/10;
i++;
}
return i;
}