展开全部
Private Sub Command1_Click()
Dim a As Single, b As Single, c As Single, p As Single, s As Single
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
p = (a + b + c) / 2
If a >= p Or b >= p Or c >= p Then
Label1.Caption = "不能构成三角形"
Else
s = Sqr(p * (p - a) * (p - b) * (p - c))
Label1.Caption = "面积为" & s
End If
End Sub
Dim a As Single, b As Single, c As Single, p As Single, s As Single
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
p = (a + b + c) / 2
If a >= p Or b >= p Or c >= p Then
Label1.Caption = "不能构成三角形"
Else
s = Sqr(p * (p - a) * (p - b) * (p - c))
Label1.Caption = "面积为" & s
End If
End Sub
2012-03-19
展开全部
先求出三角形的半周长(a+b+c)/2(a,b,c为三边)
设他的半周长为x
面积为:根号(x*(x-a)*(x-b)*(x-c))
a=val(text1.text)
b=val(text2.text)
c=val(text3.text)
x=(a+b+c)/2
text4.text=str(sqr(x*(x-a)*(x-b)*(x-c)) )
尴尬,这种代码还不会写么?
设他的半周长为x
面积为:根号(x*(x-a)*(x-b)*(x-c))
a=val(text1.text)
b=val(text2.text)
c=val(text3.text)
x=(a+b+c)/2
text4.text=str(sqr(x*(x-a)*(x-b)*(x-c)) )
尴尬,这种代码还不会写么?
追问
初学者不擅长这类不行么、
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
0.0我不晓得公式是神马。。。给我公式我能够写出LUA、VBS、VB、E、BASIC等等版本的——包括html
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询