回文数:例如12321
package corejava; import java.util.Scanner; public class Test06 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("请输入一个5位数:"); int num = sc.nextInt(); int ww = num / 10000; int gw = num % 10; int qw = num % 10000 / 1000; int sw = num % 100 / 10; if(ww == gw && qw == sw) { System.out.println("是一个回文数"); }else { System.out.println("不是一个回文数"); } } }