ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1020. Rope

Why it is wrong? Pascal.
Posted by Mad_Sanek 1 Jun 2012 14:18
Program nitochka;
var n,r,i:integer;
x: array [1..100] of real;
y: array [1..100] of real;
s,sg:real;
begin
s:=0;
readln(n,r);
For i:=1 to n do
  readln(x[i],y[i]);
sg:=2*pi*r;
For i:=1 to n-1 do  s:=s+sqrt(sqr(x[i]-x[i+1])+sqr(y[i]-y[i+1]));
s:=s+sqrt(sqr(x[n]-x[1])+sqr(y[n]-y[1]));
s:=s+sg;
writeln(s:1:2);
end.

The example calculates correct


Re: Why it is wrong? Pascal.
Posted by Pasha 18 Oct 2012 16:49
Потому что ты не берешь из файла и не выводиш в файл (assign(.....))