python_求解一元二次方程解

  • #求解一元二次方程解
    import math
    x1 = float(10 + math.sqrt(math.pow(10, 2) - 4 * 1 * 16))/(2 * 1)
    x2 = float(10 - math.sqrt(math.pow(10, 2) - 4 * 1 * 16))/(2 * 1)
    print(str.format(“方程 x * x - 10 * x + 16 = 0的解为:{0:.2f} {1:.2f}”, x1, x2))

猜你喜欢

转载自blog.csdn.net/weixin_43469680/article/details/88593631
今日推荐