|
|
back to boardsteel wrang. help meeeeeeee uses math; const p=3.14; { -> p = pi , it will more accurate} var a,r:integer; s,angl,cosa:real; begin readln (a,r); if (2*r<a) then s:=p*r*r else if (sqrt(2)*r>a) then s:=a*a else begin cosa:=a/(2*r); angl:=2*arctan(cosa); angl:=p/2-angl; s:=((a/2)*sqrt(r*r-(a*a)/4))+angl*r*r/2; s := s * 4; end; writeln (s:10:3); end. Oh my god...................Too many Errors. Oh my friend.Even though I try my best. I still get 10 WA before I got AC with your program 8::::( What a hard work....:-) First of all I use p=3.1415926535897 .......A terrible number, isn't it? Then if (2*r<a) ==> if (2*r<=a) if (sqrt(2)*r>a) ==> if (sqrt(2)*a/2<r) then angl:=2*arctan(cosa); ==> angl:=2*arccos(cosa); writeln (s:10:3); ===> writeln (s:0:3); Good luck next time. By the way .I send a E-mail to you . Reply it Ok?????? thenk you but wan i see your letter i don't undestend bicause i have no your font.please write it by 'arial' font ......ZZZzzzzzzzz > By the way my E-mail is fc_rainofstar_@163.com Send a E-mail to me Ok? |
|
|