判断回文数
输入一个大于0的整数x,
若x是回文数,则输出Yes,否则输出No
import java.util.Scanner;
public class PalindromicNumber {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int x = in.nextInt();
int t = x, y = 0;
while (t != 0) {
y = y * 10 + (t % 10);
t /= 10;
}
if (x == y) System.out.println("Yes");
else System.out.println("No");
}
}
标签:10,判断,Scanner,No,int,System,回文
From: https://www.cnblogs.com/aruhan/p/17069013.html