终于对了
# -*- coding: utf-8 -*- import math def quadratic(a,b,c): p=b*b-4*a*c if p>=0 and a!=0: x1=(-b+math.sqrt(p))/(2*a) x2=(-b-math.sqrt(p))/(2*a) return x1,x2 else: return(‘Wrong Number!') a=float(input('Please input a')) b=float(input('Please input b')) c=float(input('Please input c')) print(quadratic(a,b,c))
Sign in to make a reply
Adam常
终于对了