python 判断三个数字中的最大值,具体代码如下所示:
#判断三个数中最大值
n1= int(input('please enter the firest number:'))
n2 = int(input('please enter the second number:'))
n3 = int(input('please enter the third number:'))
max_num = 0
if n1 > n2:
max_num = n1
if n1 > n3:
max_num = n1
else:
max_num = n3
else:
max_num = n2
- 1
- 2
前往页