Java编程:判断是否是回文数

import javax.swing.JOptionPane;

自然数中还有一类数被称为回文数。回文数就是一个数的两边对称,如11,121,1221,9339,30203等等


public class CircleTest{


 public static void main(String[] args){


  String inputValue = JOptionPane.showInputDialog("请输入一个整数");


  StringBuffer source = new StringBuffer(inputValue);


  source.reverse();


  String reverseString = new String(source);


  if(reverseString.equals(inputValue)){


   System.out.println("你输入的是回文数");


  }else{


   System.out.println("你输入的不是回文数");


  }


 }


}

原文地址:https://www.cnblogs.com/Miss-Lee/p/3791687.html