题解 | 23年OPPO-a的翻转
import sys for line in sys.stdin: a_in = int(line) n = 0 a_ini = 10 * [0] for i in range(10) : a_ini[9 - i] = a_in % 10 a_in = (a_in - a_ini[9 - i]) // 10 n += 1 if a_in == 0 : break a = a_ini[10 - n : 10] b = n * [0] out = 0 for i in range(n): b[i] = int(a[i]) + int(a[n - i - 1]) out += b[i] * (10 ** (n-i-1)) print(out)