Guest User

Untitled

a guest
Dec 5th, 2019
95
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from math import sqrt
  2. import sys
  3.  
  4. a, b, c = map(float, input().split())
  5.  
  6. e = 0.0000001
  7. D = b ** 2 - 4 * a * c
  8.  
  9. if a == 0 and b == 0 and c == 0:
  10. print(-1)
  11. elif a == 0 and b != 0:
  12. print(1, -c / b)
  13. elif a != 0:
  14. if D > 0 :
  15. print(2,(-b + sqrt(D)) / (2 * a), (-b - sqrt(D))/(2 * a))
  16. elif abs(D) < e :
  17. print(1,(-b + sqrt(D)) / (2 * a))
  18. elif D < 0:
  19. print(0)
  20. else:
  21. print(0)
RAW Paste Data