Determine whether an integer is a palindrome. Do this without extra space.
click to show spoilers.
class Solution { public: bool isPalindrome(int x) { // IMPORTANT: Please reset any member data you declared, as // the same Solution instance will be reused for each test case. if (x < 0) return false; // or convert to positive to do the verification int div = 1; while (div <= x / 10) div *= 10; while (x != 0) { int first = x / div; int last = x % 10; if (first != last) return false; x = (x % div) / 10; div /= 100; } return true; } };
python —— 使用logging模块简单实现日志系统,布布扣,bubuko.com
python —— 使用logging模块简单实现日志系统
原文:http://blog.csdn.net/wangyuling1234567890/article/details/24130155