package sum;
import java.util.Scanner;
public class Ex5_3 {
public static int reverse(int num){
String b = "";
while(num!=0){
String a = Integer.toString(num%10);
num = num/10;
b += a;}
int number = Integer.parseInt(b);
return number;}
public static boolean isPalindrome(int num){
int number = reverse(num);
boolean palindrome = true;
if(num==number)
{palindrome = true;}
else
{palindrome=false;}
return palindrome;}
public static void main(String[] args) {
System.out.println("enter the number");
Scanner input= new Scanner(System.in);
int num=input.nextInt();
if((isPalindrome(num))==true)
{System.out.print("the number is palindrome.");}
else
{System.out.print("the number isnt palindrome.");}
}
}
我很认真很负责的帮你改好了 希望能采纳