Python

yukikage 发表于 3个月前 · 关联问题 一元二次方程求解

from math import * a,b,c=map(float,input().split()) d=b*b-4*a*c if d>=0: print("YES") x1=(-b+sqrt(d))/2/a x2=(-b-sqrt(d))/2/a print(f'{x1:.6f} {x2:.6f}') else: print("NO")