public class Main{
public static void main(String[] args) { for (int i = 1000;i<10000;i++){
String str1 = Integer.toString(i); char[] chars = str1.toCharArray(); StringBuffer str2 = new StringBuffer(); for (int a =chars.length-1;a>=0;a–){ str2.append(chars[a]);
}
String temp = str2.toString(); if(Integer.parseInt(temp) == i){ System.out.println(i);
}
}
}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)