feat: the quadratic formula
This commit is contained in:
parent
d8eec3d5a0
commit
7ca4ba64db
1 changed files with 12 additions and 0 deletions
12
quadratic/main.py
Normal file
12
quadratic/main.py
Normal 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}")
|
Loading…
Reference in a new issue