|
|
вернуться в форумCrash (FLT_INVALID_OPERATION) 17 test {$n+} program kaz; var l,x,x1,x2,y,y1,y2,st1,st2,st3,rast,ydl,per,h,opr:extended; begin read(x1); read(y1); read(x2); readln(y2); read(x); read(y); read(l); st1:=sqrt(sqr(x1-x)+sqr(y1-y)); st2:=sqrt(sqr(x2-x)+sqr(y2-y)); st3:=sqrt(sqr(x2-x1)+sqr(y2-y1)); per:=(st1+st2+st3)/2; h:=sqrt(per)*sqrt(per-st1)*sqrt(per-st2)*sqrt(per-st3)*2/st3; opr:=sqrt(st1*st1-h*h)+sqrt(st2*st2-h*h)-0.00001; if opr<st3 then ydl:=h-l else if st1<st2 then ydl:=st1-l else ydl:=st2-l; if st1>st2 then rast:=st1-l else rast:=st2-l; if rast<0 then rast:=0; if ydl<0 then ydl:=0; writeln(ydl:1:2); writeln(rast:1:2); end. Re: Crash (FLT_INVALID_OPERATION) 17 test st3 can be equal to zero. I changed your code: if st3=0 then h:=st1 else ... And I've got AC! thank you!!!!!!!!!!!! I am very happy. |
|
|