用VB编一元二次函数的程序

来源:百度知道 编辑:UC知道 时间:2024/05/17 08:06:29
Private Sub Command1_Click()
Dim a As Double
Dim b As Double
a = Val(Text1.Text)
b = Val(Text2.Text)
Text3.Text = Str([a + Sqr( a*a - 16b)] / 4)
Text3.Text = Str([a + Sqr( a*a - 16b)] / 4)
End Sub

这个那错了

Private Sub Command1_Click()
Dim a As Double
Dim b As Double
Dim c As Double
a = Val(Text1.Text)
b = Val(Text2.Text)
c = a + Sqr(a * a - 16 * b)
Text3.Text = Str(c / 4)
End Sub
注意:a*a - 16*b 要大于零,
否则会出错

这是什么东西??????????