for - https://www.codechef.com/problems/PALIN .
my c++ code works fine on Xcode but code chef shows wrong answer .
#include<iostream>
using namespace std;
int reverse_number(int n)
{
int r=0, a;
while(n>=1)
{
a=n%10;
r=r*10+a;
n=n/10;
}
return r;
}
int main()
{int n ;
cin >> n;
while ( n--)
{ int b;
cin >> b;
for ( int i = b ; i < 100000 ; ++i)
{
if (reverse_number(i) == i )
{ cout <<i;
break;}
}}
return 0;
}