AC
package 算法训练;
import java.util.Scanner;
public class 回文日期3 {
public static void main(String []args) {
Scanner in = new Scanner(System.in);
int date = in.nextInt();
int ans1 = 0,ans2 = 0;
boolean flag = false;
while (true) {
//先让日期自增
date = DateRun(date);
//如果flag不为true,并且判断为回文数,获取回文数,令flag为true
if (!flag && judge1(date)) {
ans1 = date;
flag = true;
}
//判断既为回文又为ABAB型
if (judge1(date) && judge2(date)) {
ans2 = date;
break;
}
}
System.out.println(ans1);
System.out.println(ans2);
in.close();