class Solution {
public:
int reverse(int x) {
long long sum=0;
while(x!=0){
sum=10*sum+x%10;
x/=10;
}
if(sum>INT_MAX || sum <INT_MIN) return 0;
return sum;
}
};
LeetCode Day6 reverse_integer
猜你喜欢
转载自blog.csdn.net/weixin_41394379/article/details/82952901
今日推荐
周排行