- 强墙
- 2009-07-12 13:52:26 @
var n,i,q:integer;a1,a2,b1,b2,x,y,c,d:array[0..10] of real;l:real;
begin
readln(n);
for i:=1 to n do
readln(x[i],a1[i],b1[i],a2[i],b2[i]);
for i:=1 to n do
if (a1[i]5) then y[i]:=0
else if (a2[i]5) then y[i]:=0
else if (b2[i]5) then y[i]:=a1[i]
else if (b1[i]5) then
begin
if (5-b1[i])>(a2[i]-5) then y[i]:=a2[i]
else y[i]:=b1[i];
end;
i:=0;
q:=0;
repeat
q:=q+1;
i:=i+1;
if y[q]0 then begin c[i]:=y[q];d[i]:=x[q];end
else i:=i-1;
until q=n;
l:=0;
d[0]:=0;
c[0]:=5;
d:=10;
c:=5;
for q:=1 to i+1 do
l:=l+sqrt((d[q]-d[q-1])*(d[q]-d[q-1])+(c[q]-c[q-1])*(c[q]-c[q-1]));
writeln(l:0:2);
end.
1 条评论
-
zgb0812 LV 8 @ 2009-07-12 14:13:57
。。。。。。。。。。
额,知道怎么错了额~~~~~~~~
- 1