/**
* @author sonate
* 判断一个数是不是回文数
* @param number
*/
public String huiWenShu(String number){
if(number != null && !"".equals(number)){
boolean flag = true;
String pattern = "\\d*";
flag = Pattern.matches(pattern, number); //matcher(number);
if(flag){
if(number.length() == 1){
return "是回文数!";
}else{
boolean f = true;
for(int i=0;i<number.length();i++){
if(number.charAt(i) != number.charAt(number.length()-(i+1))){
f = false;
break;
}
}
if(f){
return "是回文数!";
}else{
return "不是回文数!";
}
}
}else{
return "输入数据有误!";
}
}else{
return "请输入数字!";
}
}