c语言程序计算bmi指数,计算BMI的程序怎么写
滿意答案
你的公式不對(duì)a/(b*2),我?guī)湍愀某蒩/(b*1.6),看起來差不多,實(shí)際公式是a=b-1.05是標(biāo)準(zhǔn)身材。 Private Sub Command1_Click()
Dim a As Single, b As Single, c As Single
a = Val(Text1)
b = Val(Text2)
c = Round(a / (b * 1.6))
Label6.Caption = c
If Option1.Value Then
If c < 20 Then
Label8.Caption = "過輕"
ElseIf c < 25 Then
Label8.Caption = "適中"
ElseIf c < 30 Then
Label8.Caption = "過重"
ElseIf c < 35 Then
Label8.Caption = "肥胖"
ElseIf c >= 35 Then
Label8.Caption = "非常肥胖"
End If
Else
If c < 19 Then
Label8.Caption = "過輕"
ElseIf c < 24 Then
Label8.Caption = "適中"
ElseIf c < 29 Then
Label8.Caption = "過重"
ElseIf c < 34 Then
Label8.Caption = "肥胖"
ElseIf c >= 34 Then
Label8.Caption = "非常肥胖"
End If
End If
End Sub
性別分層隨機(jī)抽樣,則組成此參賽隊(duì)的概率為
02分享舉報(bào)
總結(jié)
以上是生活随笔為你收集整理的c语言程序计算bmi指数,计算BMI的程序怎么写的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 爱莲说的作者是谁啊?
- 下一篇: ebnf描述c语言语句结构,EBNF与操