x = int(input("第一个数: "))
y = int(input("第二个数: "))
z = int(input("第三个数: "))
if x > y:
x, y = y, x
if x > z:
x, z = z, x
if y > z:
y, z = z, y
print(x, y, z)
任意输入三个数字,按从小到大输出(Python)
最新推荐文章于 2024-02-27 14:14:37 发布
x = int(input("第一个数: "))
y = int(input("第二个数: "))
z = int(input("第三个数: "))
if x > y:
x, y = y, x
if x > z:
x, z = z, x
if y > z:
y, z = z, y
print(x, y, z)