package com.chy.array;
import java.util.Scanner;
public class Ex1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
System.out.println("输入一个五位的正整数");
int num = sc.nextInt();
int[] a;
a = new int[5];
int i = 0;
while (num > 0) {
a[i++] = num % 10;
num /= 10;
}
if (a[0] == a[4] && a[1] == a[3]) {
System.out.println("是回文数!");
} else {
System.out.println("不是回文数!");
}
}
}
import java.util.Scanner;
public class Ex1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
System.out.println("输入一个五位的正整数");
int num = sc.nextInt();
int[] a;
a = new int[5];
int i = 0;
while (num > 0) {
a[i++] = num % 10;
num /= 10;
}
if (a[0] == a[4] && a[1] == a[3]) {
System.out.println("是回文数!");
} else {
System.out.println("不是回文数!");
}
}
}