Write a program that examines three variables—x, y, and z—and prints the largest odd number among them. If none of them are odd, it should print a message to that effect.
#Find the largest odd number among 3 numbers
num1=int(input("请输入第一个数:"))
num2=int(input("请输入第二个数:"))
num3=int(input("请输入第三个数:"))
if num1%2==0 and num2%2==0:
if num3%2!=0:
biggest=num3
else:print("这三个数都不是奇数")
elif num1%2==0 and num2%2!=0:
if num3%2==0 or num2>num3:
biggest=num2
else:biggest=num3
elif num1%2!=0 and num2%2==0:
if num3%2==0 or num1>num3:
biggest=num1
else:biggest=num3
elif num1%2!=0 and num2%2!=0:
if num3%2!=0:
biggest=num1
if biggest<num2:
biggest=num2
if biggest<num3:
biggest=num3
elif num1>num2:
biggest=num1
else:biggest=num2
print("三个数中最大的奇数为:%s"% biggest)