编写一个程序,要求用户输入5个数字,并输出这些数字中的最大值和最小值。例如,如果用户输入2456 457 13 999 35,则输出如下:
最多的是2456个
最小的数字是35
在Python中a = input()
first = int(a)
b = input()
second = int(b)
c = input()
third = int(c)
d = input()
fourth = int(d)
if a > b or a > c or a > d:
print ('the larges number' + a)
elif a < b or a < c or a < d:
print ('the smallest number' +a )
elif b > a or b > c or b > d:
print ('the larges number' + b)
elif b < a or b < c or b < d:
print ('the smallest number is' + b )
elif d > a or d > b or d > c:
print ('the biggest number is' + d )
elif d < a or d < b or d < c:
print ('the smallest numbet is'+ d)
else:
我想出了这个主意,但我认为它行不通
数字,而且输出最大的
这些数字中最小的一个。在
在我的模块手册中,我有这个例子
^{pr2}$
然而,在这之后,没有进一步的解释我如何解决这个问题。你能帮帮我吗?在
我需要用while循环来解决问题,
我对编程很陌生,请帮忙。在