题目描述:
答案:
代码:
def reverse(self, x: int) -> int:
s= str(abs(x))
s=s[::-1]
if x<0:
s="-"+s
x=int(s)
if -2**31<=x<=2**31-1:
return x
else:
return 0