https://leetcode.com/problems/reverse-integer/
class Solution {
public:
int inf = ~0u >> 1;
int reverse(int x) {
if(x == 0)return 0;
long long tx = x;
long long ans = 0;
for(int i = 0;tx;i++){
ans = ans * 10 + tx % 10;
tx /= 10;
}
return int(ans) == ans?ans:0;
}
};