python的一种解答

LeeRF 发表于 1个月前 · 关联问题 反转三位数整数

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

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

else:

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