|
|
back to boardPlease help me ! Why I got WA test #2 ! I think my program is right but why WA ? Here is my code : Const Eps = 0.01 ; Var AC , AD , BC , BD , CD , BC2 , BD2 , AC2 , AD2 : Extended ; BEGIN Read( AC , AD , BC , BD ) ; BD2 := BD * BD ; AC2 := AC * AC ; BC2 := BC * BC ; AD2 := AD * AD ; If Abs( AC * AD - BC * BD ) < Eps then Begin Writeln('Impossible') ; Halt ; End ; CD := (AC2 + AD2) * BC * BD - (BC2 + BD2) * AC * AD ; CD := CD / ( BC * BD - AC * AD ) ; If CD < 0.00000 then Writeln('Impossible.') Else Begin CD := Sqrt( CD ) ; Writeln('Distance is ',CD*1000:0:0,' km.') ; End ; END. Impossible>>>>Impossible. |
|
|