这是vb 帮我看看哪里出错了 b = Val(Text2.Text) c = Val(Text3.Text)
PrivateSubCommand1_Click()Dima,b,c,x1,x2AsLonga=Val(Text1.Text)b=Val(Text2.Text)c=Val...
Private Sub Command1_Click()
Dim a, b, c, x1, x2 As Long
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
If b ^ 2 - 4 * a * c > 0 Then
x1 = (-b + Sqr(b ^ 2 - 4 * a * c)) / (2 * a) And x2 = (-b - Sqr(b ^ 2 - 4 * a * c)) / (2 * a)
Else
Text4.Text = "数据错误"
End If
Text5.Text = Str(x1)
Text6.Text = Str(x2)
End Sub 展开
Dim a, b, c, x1, x2 As Long
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
If b ^ 2 - 4 * a * c > 0 Then
x1 = (-b + Sqr(b ^ 2 - 4 * a * c)) / (2 * a) And x2 = (-b - Sqr(b ^ 2 - 4 * a * c)) / (2 * a)
Else
Text4.Text = "数据错误"
End If
Text5.Text = Str(x1)
Text6.Text = Str(x2)
End Sub 展开
2个回答
展开全部
Private Sub Command1_Click()
Dim a, b, c, x1, x2
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
If (b ^ 2 - 4 * a * c) > 0 Then
x1 = (-b + Sqr(b ^ 2 - 4 * a * c)) 野桥/ (2 * a)
x2 = (-b - Sqr(b ^ 2 - 4 * a * c)) / (2 * a)
Text5.Text = Str(x1)
旅御 Text6.Text = Str(x2)
Else
Text4.Text = "颂镇猛数据错误"
End If
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Command1_Click()
Dim a as single, b as single, c as single, x1 as single, x2 as single
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
If (b ^ 2 - 4 * a * c) >= 0 Then
x1 = (-b + Sqr(b ^ 2 - 4 * a * c)) / (2 * a)
x2 = (-b - Sqr(b ^ 2 - 4 * a * c)) / (2 * a)
Text5.Text = Str(x1)
Text6.Text = Str(x2)
Else
Text4.Text = "销高无实数好者解!友斗薯"
End If
End Sub
Dim a as single, b as single, c as single, x1 as single, x2 as single
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
If (b ^ 2 - 4 * a * c) >= 0 Then
x1 = (-b + Sqr(b ^ 2 - 4 * a * c)) / (2 * a)
x2 = (-b - Sqr(b ^ 2 - 4 * a * c)) / (2 * a)
Text5.Text = Str(x1)
Text6.Text = Str(x2)
Else
Text4.Text = "销高无实数好者解!友斗薯"
End If
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询