I’m just a beginner but this code works fine locally , still getting WA
please help
#include
using namespace std;
int main()
{
long int t,i,rem,sum,temp,z;
long int a[100];
std::ios::sync_with_stdio(false);
cin >> t;
for(i=0;i<t;i++)
{
cin>>a[i];
}
for(i=0;i<t;i++)
{ a[i]=a[i]+1;
temp=a[i];
while(1)
{
z=temp;
sum=0;
while(z!=0)
{
rem=z%10;
sum=sum*10+rem;
z=z/10;
}
if(sum==temp)
{
cout<<temp<<endl;
break;
}
else
{
temp=temp+1;
}
}
}
return 0;
}