摘要:
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 阅读全文
摘要:
给出一个 32 位的有符号整数,你需要将这个整数中每位上的数字进行反转。 class Solution: def reverse(self, x: int) -> int: num = 0 #返回x的绝对值给a a = abs(x) while(a != 0): #123 #a=123 #num=0 阅读全文