LeetCode 09. 回文数
生活随笔
收集整理的這篇文章主要介紹了
LeetCode 09. 回文数
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
原題鏈接
class Solution { public:bool isPalindrome(int x) {if(x<0)return false;if(x>=0 && x<10)return true;long long temp = 0;int xx = x;while(x!=0){int n = x % 10;temp = temp * 10 + n;x /=10;}if(temp == xx)return true;else{return false;}} };?
總結
以上是生活随笔為你收集整理的LeetCode 09. 回文数的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 党员发展对象备案报告范文(党员发展对象备
- 下一篇: 世嘉安卓模拟器(世嘉 安卓)