心态爆炸


  • 0
    C

    class Solution {
    public:
    int reverse(int x) {
    int reverse=0;
    while(x!=0)
    {
    if(abs(reverse)>INT_MAX/10) return 0;
    reverse=reverse*10+x%10;
    x/=10;
    }
    return reverse;
    }
    };


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.