您的位置:首页 > 其它

UVa OJ 375-Inscribed Circles and Isosceles Triangles

2011-01-13 15:15 381 查看
简单数学题:

{
Author:wzx961008
Problem:UVa 375-Inscribed Circles and Isosceles Triangles
Verdict:Accepted
Language:PASCAL
Run Time:0.088s
Submission Date:2011-01-12 16:08:51
}
var l,n,i,j,tmp:longint;
b,h,h1,r,r1,e,ans:double;
s:string;
begin
readln(n);
for i:=1 to n do begin
readln;
readln(b,h);
e:=sqrt(b*b/4+h*h);
r:=b*h/(2*e+b);
h1:=h; r1:=r;
while r1>=1e-6 do begin
h1:=h1-2*r1;
r1:=h1*r/h;
end;
ans:=(h-h1)*pi;
tmp:=trunc(ans);
str(tmp,s);
l:=length(s);
for j:=1 to 6-l do write(' ');
writeln(ans:0:6);
if i<>n then writeln;
end;
end.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: