开发程序求解a*x^2 + b*x+c=0一元二次方程(a,b,c可自行输入)。做的时候出现2处错误,高手指点下,谢谢 5
Dima,b,cAsIntegerDimx1,x2AsDoublePrivateSubcommand1_click()a=InputBox("请输入a","",0)b=I...
Dim a, b, c As Integer
Dim x1, x2 As Double
Private Sub command1_click()
a = InputBox("请输入a", "", 0)
b = InputBox("请输入b", "", 0)
c = InputBox("请输入c", "", 0)
label1.Caption = a & "* x ^ 2 +" & b & "* x + " & c & "="
End Sub
Private Sub command2_click()
Dim fi As Integer
fi = b ^ 2 - 4 * a * c
If fi < 0 Then
labeL2.Caption = (-b) / (2 * a)
LABEL3.Caption = ""
Else
labeL2.Caption = ((-b) + Sqr(b ^ 2 - 4 * a * c))
LABEL3.Caption = ((-b) - Sqr(b ^ 2 - 4 * a * c)) / (2 * a)
End If
End Sub
这是程序代码,做的时候出现实时错误,会做的加我247827979qq.com 展开
Dim x1, x2 As Double
Private Sub command1_click()
a = InputBox("请输入a", "", 0)
b = InputBox("请输入b", "", 0)
c = InputBox("请输入c", "", 0)
label1.Caption = a & "* x ^ 2 +" & b & "* x + " & c & "="
End Sub
Private Sub command2_click()
Dim fi As Integer
fi = b ^ 2 - 4 * a * c
If fi < 0 Then
labeL2.Caption = (-b) / (2 * a)
LABEL3.Caption = ""
Else
labeL2.Caption = ((-b) + Sqr(b ^ 2 - 4 * a * c))
LABEL3.Caption = ((-b) - Sqr(b ^ 2 - 4 * a * c)) / (2 * a)
End If
End Sub
这是程序代码,做的时候出现实时错误,会做的加我247827979qq.com 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询