#37685: python須注意測資點#4


s110229@student.cysh.cy.edu.tw (許鈞閎)


第一次寫報告 請見諒

import math
a,b,c=map(int,input().split())
d=b**2-4*a*c #判別式
if d>0:
    x1=int((-b+math.sqrt(d))/(2*a)) #公式解,-b正負根號(判別式)
    x2=int((-b-math.sqrt(d))/(2*a))
    print('Two different roots x1='+str(x1)+' , '+'x2='+str(x2))
elif d==0:
    x=int((-1*b+(d**0.5))/(2*a)) #可以直接套-1不然容易NA(其實是懶 ㄏ)
    print('Two same roots x=',x,sep='')
else:
    print('No real root')
dontcopythissentencetogethermybrother