Function quadratic (a As double, b As double, c As double) As Double
Dim x,y As Double
if (a = 0) then
Console.Writeline("no solution for a = 0")
else if
((b * b - 4 * a * c) <0)
Console.Writeline("no real solutions")
else
x = ((- b + Math.Sqrt(b * b - 4 * a * c)) / ( 2 * a))
y = ((- b - Math.Sqrt(b * b - 4 * a * c)) / ( 2 * a))
if (x > y) then
Console.Writeline(x)
else
Console.Writeline(y)
End if
End if
End Function
答案 0 :(得分:1)
我不会为你检查你的数学:-)但如果你改变了这个:
ElseIf ((b * b - 4 * a * c) < 0) Then
Console.Writeline("no real solutions")
对此:
sudo gem install -n /usr/local/bin cocoapods
pod install
pod update
它编译并运行......