class Solution {
public:
/**
*
* @param x int整型
* @return int整型
*/
int reverse(int x) {
// write code here
long long res = 0;
while(x) {
res = res * 10 + x % 10;
x /= 10;
}
if(res < INT32_MIN || res > INT32_MAX) return 0;
return res;
}
}; 
京公网安备 11010502036488号