Hello
Can you please help me to get rid of Runtime Error NZEC
spoj.com/problems/PALIN/
package palindrome;
import java.io.* ;
import java.util.* ;
public class Main {
public static void main(String[] args) {
int n,p ;
String str ;
Scanner sc = new Scanner(System.in);
p=sc.nextInt() ;
for (int k= 0 ; k<p ; ++k)
{
n=sc.nextInt() ;
while(!IsPalindrome(n)) n++ ;
System.out.println(n) ;
}
return ;
}
public static boolean IsPalindrome(int n)
{
String str ;
str=Integer.toString(n) ;
int l=str.length() ;
for(int i = 0 ; i<l; i++)
{
if(l==0) return false ;
if (l==1) return true ;
if(str.charAt(i) != str.charAt(l-i-1)) return false ;
}
return true ;
}
}