vb小程序题
展开全部
Private Sub Command1_Click()
Dim a As Single, b As Single, c As Single, p As Single
a = InputBox("a=", "求三角形的面积", 10)
b = InputBox("b=", "求三角形的面积", 10)
c = InputBox("c=", "求三角形的面积", 10)
p = (a + b + c) / 2
Print "a="; a, "b="; b, "c="; c
Print "三角形的面积="; Sqr(p * (p - a) * (p - b) * (p - c))
End Sub
Private Sub Command2_Click()
Dim x As Single, y As Single
x = Text1.Text
If x > 10 Then
y = Sqr(x) + Sin(x)
ElseIf x = 10 Then
y = 0
Else
y = 2 * x ^ 2 + 6
End If
Label2.Caption = "y=" & y
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询