Python-70分,2、5、6WA了求大佬看看

P1307 [NOIP2011 普及组] 数字反转

ytt02_11 @ 2023-03-22 21:42:30

n = str(input())
x = n[::-1]
y = int(x.replace("-",""))
if n[0]=="-":
    print("-%d" % y)
else:
    print(x)

by 01bigdata @ 2023-03-24 00:53:45

210带进去看看噜


by luogu_administrators @ 2024-06-18 21:16:54

没有考虑到末尾有0的情况! 再次修改


|