https://leetcode-cn.com/problems/reverse-integer/
class Solution {
public int reverse(int x) {
int sum = 0;
while(x != 0){
int sum2 = sum * 10 + x % 10;
x /= 10;
if(sum2 / 10 != sum){
return 0;
}
sum = sum2;
}
return sum;
}
}