以下是一个判断一元二次方程ax2+bx+c=0根的方程的程序,请补充该程序。提示: ?当a<>0时有两个根.设delta=b2-4ac,当delta>0时,有两个不同的实根.当delta=0时,有两个相同的实根。当delta<0时,有两个不同的虚根。 ?当a=0,b<>0时,有一个根。 ?当a=0、b=0时,方程无意义。 Private Sub Command1_Click() Dim a As Single Dim b As Single Dim c As Single Dim sb As Single Dim xb As Single Dim re As Single a = InputBox (“请输入a的值”) c = InputBox(“请输入c的值”) if【 】then delta = b ^2- 4 * a * c re = -b/(2 * a) if【 】then sb = Sqr (delta)/(2 * a) Print “方程有两个实根” Elseif delta = 0 then Print “方程有两个相等实根” Else xb = Sqr( - delta)/(2 * a) Print “方程有两个虚要” End if Else if【 】then ygz = - b / c Print “方程仅有一个根” Else print “方程无意义” End if End if End Sub
答案不对?请尝试站内搜索