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
先求缓激出三角形的半仔拿周长(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)) )
尴尬,这种代码还不会写么?
0.0我不晓得公式是神马。。。给我公式我能够写出LUA、隐侍VBS、VB、E、BASIC等等版本的灶罩吵——包闷轮括html