VB程序设计-体型判断

VB程序设计-体型判断,第1张

Option Explicit

Private Sub Command1_Click()

Dim t As Single

Dim w As Single, h As Single

w = InputBox("请输入体重:")

h = InputBox("请输入身高:")

t = w / h ^ 2

Select Case t

Case Is <= 18

MsgBox "低体重"

Case Is <= 25

MsgBox "体重正常"

Case Is <= 27

MsgBox "超重体重"

Case Else

MsgBox "肥胖"

End Select

End Sub

clear

input "请输入身高cm" to sg

input "请输入体重kg" to tz

do case

case sg<150

?"特殊体型"

case tz=sg-150

?"标准"

case tz>sg-150

?"过胖"

case tz<sg-150

?"过瘦"

endcase

return


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12174241.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-21
下一篇 2023-05-21

发表评论

登录后才能评论

评论列表(0条)

保存