This is the problem
spoj.pl/problems/PALIN/
and my code is
[code]
#include
int palindrome(int);
void main()
{
int a[10],c,t,i;
scanf("%d",&t);
for(i=0;iscanf("%d",&a[i]);
for(i=0;i{
c=a[i];
while(palindrome(c)!=1)
c++;
printf("\n%d",c);
}
exit(1);
}
int palindrome(int n)
{
int i,j,key,b[10];
i=0;
key=1;
while(n!=0)
{
b[i]=n%10;
n=n/10;
i++;
}
for(j=0;j<=i/2;j++)
{
if(b[j]==b[i-j-1])
continue;
else
{
key=0;
break;
}
}
return(key);
}
[/code]
when I run this code, I get runtime error (SIGSEGV)