import java.applet.*;
import java.awt.*;
import javax.swing.JOptionPane;
public class panduanwenhunshu { public static void main(String args[]){ String s1; int x,i=0,k=0; int a = 0; int [] str=new int[30]; String output1="请输入一个数字:"; String output2="这个数不是回文数!"; String output3="这个数是回文数!"; JOptionPane.showMessageDialog(null,output1,"判断回文数:",JOptionPane.INFORMATION_MESSAGE); s1=JOptionPane.showInputDialog(null,"请输入回文数:","判断回文数:",javax.swing.JOptionPane.QUESTION_MESSAGE); x=Integer.parseInt(s1); while(x>0){ str[k++]=x%10+'0'; x=x/10; } for(i=0;i<=k/2;i++){ if(str[i]!=str[k-i-1]) { a=0; break; } else a=1; } if(a==1) JOptionPane.showMessageDialog(null,output3,"判断回文数:",JOptionPane.INFORMATION_MESSAGE); else JOptionPane.showMessageDialog(null,output2,"判断回文数:",JOptionPane.INFORMATION_MESSAGE); } }