Dim X As Long
Dim x1 As Long
Dim x2 As Long
Dim a As Long
Dim b As Long
Dim c As Long
a = Text1.Text
b = Text2.Text
c = Text3.Text
If a = 0 Then
x1 = (-c) / b
Text4.Text = x1
Text5.Text = x1
Exit Sub
End If
If b ^ 2 - 4 * a * c < 0 Then
MsgBox "没有根"
Exit Sub
End If
x1 = (-(b) + Sqr(b ^ 2 - 4 * a * c)) / 2 * a
x2 = (-(b) - Sqr(b ^ 2 - 4 * a * c)) / 2 * a
Text4.Text = x1
Text5.Text = x2