feat: the quadratic formula

This commit is contained in:
Muhammad Nauman Raza 2025-01-22 21:27:32 +00:00
parent d8eec3d5a0
commit 7ca4ba64db
Signed by: devraza
GPG key ID: 91EAD6081011574B

12
quadratic/main.py Normal file
View file

@ -0,0 +1,12 @@
import sys
a,b,c = list(map(int, input().split(' ')))
x1 = (-1*b - (b**2 - 4*a*c)**(1/2))/(2*a)
x2 = (-1*b + (b**2 - 4*a*c)**(1/2))/(2*a)
if x1 == x2:
print(x1)
sys.exit()
else:
print(f"{x1}, {x2}")