text1.text 身高
text2.text 体重
text3.text 性别
text4.text 输出判断结果
Private Sub Command1_Click()
If Text3.Text = "女性" Then
If Abs((Text1.Text - 102) * 2) - Text2.Text <= 3 Then
Text4.Text = "正常" '正负三斤以内正常
ElseIf (Text1.Text - 102) * 2 - Text2.Text > 3 Then
Text4.Text = "偏瘦" '小于标准体重三斤偏瘦
ElseIf (Text1.Text - 102) * 2 - Text2.Text < 3 Then
Text4.Text = "偏胖“ '大于标准体重三斤偏胖"
End If '如果是女性的话从text4.text输出判断结果
ElseIf Text3.Text = "男性" Then
If Abs((Text1.Text - 100) * 2) - Text2.Text <= 3 Then
Text4.Text = "正常" '正负三斤以内正常
ElseIf (Text1.Text - 100) * 2 - Text2.Text > 3 Then
Text4.Text = "偏瘦" '小于标准体重三斤偏瘦
ElseIf (Text1.Text - 100) * 2 - Text2.Text < 3 Then
Text4.Text = "偏胖“ ’大于标准体重三斤偏胖"
End If
'‘如果是男性的话从text4.text输出判断结果
End If
End Sub
但是你这个计算标准体重的公式明显有问题。代码的话就这个了。经测试没问题。
追问VB语言。调用triangle子过程,完成三角形打印
本回答被提问者采纳