Дамп всех задач
This commit is contained in:
26
Pascal/08.12.16/Program1.pas
Normal file
26
Pascal/08.12.16/Program1.pas
Normal file
@@ -0,0 +1,26 @@
|
||||
var
|
||||
n,i:integer;
|
||||
r,x1,x2,x3,y1,y2,y3,per:real;
|
||||
f:Text;
|
||||
|
||||
begin
|
||||
Assign(f, 'input.txt');
|
||||
Reset(f);
|
||||
Read(f, n);
|
||||
read(f, r);
|
||||
Read(f, x1, y1);
|
||||
x3:=x1;
|
||||
y3:=y1;
|
||||
per:=0;
|
||||
for i:=0 to n-2 do begin
|
||||
Read(f, x2, y2);
|
||||
per:=per + Sqrt(Sqr(x2-x1)+Sqr(y2-y1));
|
||||
x1:=x2; y1:=y2;
|
||||
end;
|
||||
per:=per+Sqrt(Sqr(x1-x3)+Sqr(y1-y3)+Sqr(x2-x1)+Sqr(y2-y1));
|
||||
per:=per+((2*Pi*r)/4)*n;
|
||||
Close(f);
|
||||
Rewrite(f, 'output.txt');
|
||||
write(f, per:0:2);
|
||||
Close(f);
|
||||
end.
|
||||
5
Pascal/08.12.16/input.txt
Normal file
5
Pascal/08.12.16/input.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
4 1
|
||||
0.0 0.0
|
||||
2.0 0.0
|
||||
2.0 2.0
|
||||
0.0 2.0
|
||||
1
Pascal/08.12.16/output.txt
Normal file
1
Pascal/08.12.16/output.txt
Normal file
@@ -0,0 +1 @@
|
||||
14.28
|
||||
Reference in New Issue
Block a user