Advertisement
Guest User

Untitled

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