python的一种解答

LeeJunhao 发表于 6天前 · 关联问题 反转三位数整数

n = int(input()) if n > 0:

a = str(n)[::-1] print(a)

else:

n = -n a = str(n)[::-1] print(a)