沉浸在自己的世界里

关注

leetcode 9 回文数

沉浸在自己的世界里

关注

阅读 37

2023-07-22

 

class Solution {
    public boolean isPalindrome(int x) {
        if(x < 0){
            return false;
        }
        int num = x;
        int value = 0;
        while(num > 0){
            value = value * 10 + num % 10;
            num = num / 10;
        }
        return value == x;

    }
}

相关推荐

魔都魅影梅杜萨

leetcode题目9:回文数

魔都魅影梅杜萨 80 0 0

_铁马冰河_

leetcode 9. 回文数

_铁马冰河_ 187 0 0

毅会

Leetcode笔记-9 回文数

毅会 86 0 0

拾光的Shelly

【LeetCode】9. 回文数

拾光的Shelly 114 0 0

素的盐

LeetCode 9.回文数

素的盐 56 0 0

素锦时年_1b00

leetcode算法9.回文数

素锦时年_1b00 100 0 0

朱小落

LeetCode-9. 回文数(Java)

朱小落 49 0 0

飞进科技

Python描述 LeetCode 9. 回文数

飞进科技 149 0 0

杰克逊爱学习

【9】回文数

杰克逊爱学习 115 0 0

WikongGuan

9. 回文数、Leetcode的Go实现

WikongGuan 61 0 0

精彩评论(0)

0 0 举报