package x;
import javax.swing.*;
public class X {
public static void main(String[] args) {
String s=(String)JOptionPane.showInputDialog(null,"请输入一个整数","输入对话框",JOptionPane.PLAIN_MESSAGE);
Long m,n=Long.parseLong(s);
System.out.println(n+"");
n=Math.abs(n);
m=n/10;
int i=1;
while(m>0){i=i*10;m=m/10;}
while(n>0)
{
if(n/i==n%10)
{n=n%i;n=n/10;i=i/100;}
else
break;
}
if(n==0)
System.out.println("回文数");
else
System.out.println("不是回文数");
}
}
看下这个吧!自己改改