Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- kek = - 1
- while kek < 0:
- a = int(input('Введите a '))
- b = int(input('Введите b '))
- c = int(input('Введите c '))
- result = b * b - 4 * a * c
- print('Дискриминант =',result)
- if result < 0:
- print('Корней нет')
- elif result > 0:
- print('Сейчас мы выведем корни...')
- r = math.sqrt(result)
- print('Дискриминант под корнем =',r)
- x1 = (-b - r) / (2 * a)
- print('x1 =',x1)
- x2 = (-b + r) / (2 * a)
- print('x2 =',x2)
- if result == 0:
- print('Корень один, секундочку, подсчитаем...')
- r = math.sqrt(result)
- print('Дискриминант под корнем =',r)
- x3 = -b / (2 * a)
- print('x =',x3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement