直接int怎么会报错?
n = int(input()) t = 0 while n not in (0,2178): n = abs(n-int(str(n)[::-1])) t += 1 print(t)