# 读取用户输入的字符串并转换为整数 n = int(input()) # 初始化逆序后的数字 dn = 0 # 逆序处理 while n > 0: dn = dn * 10 + n % 10 n //= 10 # 输出逆序后的数字 print(dn)
求助大佬