> 数学 >
程序设计 用求根公式求一元二次方程x^2+3x+2=0的解.
人气:197 ℃ 时间:2020-05-04 16:15:52
解答
python
import math
a=1.0
b=3.0
c=2.0
x1 = (-b + math.sqrt(b**2-4*a*c))/(2*a)
x2 = (-b - math.sqrt(b**2-4*a*c))/(2*a)
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版