为什么我在dvc++和codeblock上可以运行,到了oj上就运行不了了?


#include<stdio.h>
#include<math.h>
int huiwen(int j)
{
    int a,p=0,item;
    item=j;
    while(j!=0)
    {
        a=j%10;
        j=j/10;
        p=p*10+a;
    }
    if(p==item)
    return 1;
    else
    return 0;
}
int main()
{
    int i,n=0,j=0,t,z,y;
    char a[999],b[999];
    for(y=1;y>0;y++)
    {
        a[999]=0;b[999]=0;j=0;n=0;
        while((a[n]=getchar())!='\n')
    n++;
    a[n]='\0';
    for(i=0;i<n;i++)
    {
        b[i]=a[i]-'0';
    }
    z=n-1;
    for(i=0;i<n;i++)
    {
        j+=b[i]*pow(10,z);
        z--;
    }
    for(i=j+1;i>0;i++)
    {
        if(huiwen(i)==1)
        {
            printf("%d\n",i);
            break;
        } 
    }
    }
 } 

img

img