class Solution {
/**
* 整理思路:
* 12345
* 5
* 54
* 543
* 5432
* f(n+1) = f(n)*10 + 余数
* 找规律,项与项之间关系
*
* @param x
* @return int
* @author xx
* @date 2020/8/19 11:47
*/
public int reverse(int x) {
long n = 0;
while(x != 0) {
n = n*10 + x%10;
x = x/10;
}
return (int)n==n? (int)n:0;
}
}