java 判断回文数
package com.oop;
public class Demo1 {
public static void main(String[] args) {
int x = 12321;
String s1 = String.valueOf(x);
String s2 = new StringBuffer(s1).reverse().toString();
if(s1.equals(s2)) {
System.out.println("Yes");
}else {
System.out.println("No");
}
}
}
本文来自博客园,作者:wjxuriel,转载请注明原文链接:https://www.cnblogs.com/my-blog-site/p/16392109.html

浙公网安备 33010602011771号