摘要: class Solution: def isPalindrome(self, x: int) -> bool: a = x if a<0: return False else: num = 0 while(a!=0): temp = a%10 a = a//10 num = num*10+temp 阅读全文
posted @ 2020-02-14 14:29 Halo辉Go 阅读(405) 评论(0) 推荐(0) 编辑
摘要: 给出一个 32 位的有符号整数,你需要将这个整数中每位上的数字进行反转。 class Solution: def reverse(self, x: int) -> int: num = 0 #返回x的绝对值给a a = abs(x) while(a != 0): #123 #a=123 #num=0 阅读全文
posted @ 2020-02-10 17:45 Halo辉Go 阅读(104) 评论(0) 推荐(0) 编辑