Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math as m
- a = int(input('Введите a: '))
- b = int(input('Введите b: '))
- c = int(input('Введите c: '))
- D = b*b-4*a*c
- if D > 0:
- x1 = str((-b + m.sqrt(D))/(2*a))
- x2 = str((-b - m.sqrt(D))/(2*a))
- print('2 корня, х1 = '+ x1 +' x2 = '+x2)
- elif D == 0:
- x1 = str(-b/(2*a))
- print('1 корень, x='+x1)
- elif D < 0:
- print ('корней нет')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement