# -*- coding: UTF-8 -*-
__metaclass__=type
import math
#一元二次方程求解x^2+2x+1=0
def yiyuan_jie(a,b,c):
delta=b*b-4*a*c
if delta<0:
return u'无解!'
try:
if delta==0:
return -(b/(2*a))
if delta>0:
squart_delta=math.sqrt(delta)
x1=(-b+squart_delta)/(2*a)
x2=(-b-squart_delta)/(2*a)
return '{:.2f} {:.2f}'.format(x1,x2)
except ZeroDivisionError:
print u'分母不能为零!'
if __name__=='__main__':
print yiyuan_jie(5,8,1)