Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- a, b, c = map(int, input().split())
- #ax**2+bx+c-16=0
- c -= 16
- D = b**2-4*a*c
- if D < 0:
- print("Нет корней")
- elif D == 0:
- x = -1*b/(2*a)
- print("Один корень: " + x)
- else:
- sqrtd = math.sqrt(D)
- x1 = (-1*b-sqrtd)/(2*a)
- x2 = (-1*b+sqrtd)/(2*a)
- print(f"Два корня: {x1} и {x2}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement