input “x=”;x
If x>8 then y=3*x-2 else y=2*x+1
print “y=”;y
end
(x的值输入为6)
运行结果为( )
a=5
if a>5:
print(5)
print(3)
W=float( input(输入体重(kg):") h= float( input("输入身高(m):")) bmi=w/(h*h) #BMI=体重(kg)/身高的平方(m) if bmi<18.5: print("偏瘦") elif 18.5<=bmi<24: print("正常") else: print("偏胖") |