a006-一元二次方程式
http://zerojudge.tw/ShowProblem?problemid=a006
內容 :
求一元二次方程式 ax2+bx+c=0 的根
輸入說明 :
輸入三個整數 a, b, c
輸出說明 :
Two different roots x1=?? , x2=??
Two same roots x=??
No real root
PS: 答案均為整數,若有兩個根則大者在前
範例輸入 :
若題目沒有特別說明,則應該以多測資的方式讀取,若不知如何讀取請參考 a001 的範例程式。
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顯示
出處 :
Jiangsir