Помогите составить блок схему по коду
Добавлено: 10 май 2010, 15:48
Помогите составить блок схему по коду
Код: Выделить всё
uses crt;
const nmax=100;
var x,y:array[1..nmax] of real;
n,i,j,imn:byte;
mn:real;
begin
clrscr;
randomize;
repeat
write('Kolichestvo tochek ot 2 do ',nmax,' n=');
readln(n);
until n in [1..nmax];
for i:=1 to n do
begin
x[i]:=10*random-4;
y[i]:=10*random-4;
end;
writeln('Koordinatu:');
write('X');
for i:=1 to n do
write(x[i]:5:1);
writeln;
write('Y');
for i:=1 to n do
write(y[i]:5:1);
writeln;
writeln;
mn:=sqrt(sqr(x[1])+sqr(y[1]));
imn:=1;
for i:=1 to n do
if sqrt(sqr(x[i])+sqr(y[i]))<mn then
begin
mn:=sqrt(sqr(x[i])+sqr(y[i]));
imn:=i;
end;
writeln('Minimalnoe rastojanie do nachala koordinat imeet tochka');
write('Nomer ',imn,' = ',mn:0:2);
readln
end.