【发布时间】:2021-01-25 12:47:28
【问题描述】:
我的目标是能够在终端中输入一个大(6 位)数字,并让它返回中间两位数字,交换。
我的代码如下:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
f = int(input())
addition = ((a * 0) + (b * 0) + (d * 10))
addition_two = ((c) + (e * 0) + (f * 0))
print(addition + addition_2)
我不确定如何调整它以使其正常工作。
【问题讨论】:
-
你了解十进制数字系统的工作原理吗?为什么将输入值乘以 0?
-
给定的解决方案不起作用吗?
标签: python python-3.x input integer