You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
255 B
Python

import sys
a = int(sys.argv[1])
b = int(sys.argv[2])
c = int(sys.argv[3])
d = b ** 2 - 4 * a * c
if d > 0:
print((-b + (b ** 2 - 4 * a * c) ** .5) / (2 * a))
print((-b - (b ** 2 - 4 * a * c) ** .5) / (2 * a))
elif not d:
print(-b / (2 * a))