解法1:
public int reverseInteger(int number){
int bai = (number / 100) % 10;
int shi = (number / 10) % 10;
int ge = (number / 1) % 10;
return ge*100 + shi * 10 + bai;
}
解法2:
//直接用 StringBuilder 的 reverse 方法,不过效率是个问题
System.out.println(Integer.parseInt(new StringBuilder(number + "").reverse().toString()));