Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. a = int(input('Введите a: '))
  2. b = int(input('Введите b: '))
  3. c = int(input('Введите c: '))
  4. D = b*b-4*ac
  5. if D > 0:
  6. x1 = str((-b + sqrt(D))/(2*a))
  7. x2 = str((-b - sqrt(D))/(2*a))
  8. print('2 корня, х1 = '+ x1 +' x2 = '+x2)
  9. elif D == 0
  10. x1 = str(-b/(2*a))
  11. print('1 корень, x='+x1)
  12. elif D < 0:
  13. print ('корней нет')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement