题目:

题解:
class Solution {
public:
int reverse(int x) {
int rev = 0;
while (x != 0) {
if (rev < INT_MIN / 10 || rev > INT_MAX / 10) {
return 0;
}
int digit = x % 10;
x /= 10;
rev = rev * 10 + digit;
}
return rev;
}
};


















![蓝桥杯(4):python动态规划DF[1]](https://img-blog.csdnimg.cn/direct/0c6768dd0acd471daa755f1852ddd22b.png)
