內容 :
求一元二次方程式 ax2+bx+c=0 的根
輸入說明 :輸入三個整數 a, b, c
輸出說明 :
Two different roots x1=?? , x2=??
Two same roots x=??
No real root
PS: 答案均為整數,若有兩個根則大者在前
範例輸入 :
1 3 -10 1 0 0 1 1 1
範例輸出 :
Two different roots x1=2 , x2=-5 Two same roots x=0 No real root
提示 :
* 以 double 宣告 * 本系統以 Linux 上 g++ 進行編譯,請注意 -0 的現象,應改為0顯示
出處 :http://zerojudge.tw/ShowProblem?problemid=a007
程式碼:
Be First to Comment