Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- import cmath
- def input_coef(): #ввод данных
- print("Введите коэффициенты:")
- a=float(input("a="))
- b=float(input("b="))
- c=float(input("c="))
- d=float(input("d="))
- return a,b,c,d
- def check(coef): #проверка, что уравнение кубическое
- a=float(coef[0])
- b=float(coef[1])
- c=float(coef[2])
- d=float(coef[3])
- print ("Заданы коэффициенты:", a, b, c, d)
- if abs(a) > 1e-6:
- return a, b, c, d
- else:
- return False
- def Vieta(coef): #решение уравнения
- print ("заглушка")
- return x1, x2, x3
- coef = input_coef()
- check = check(coef)
- if check != False:
- roots = Vieta(coef)
- else:
- print("Уравнение не кубическое")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement