Pagini recente » Cod sursa (job #772152) | Cod sursa (job #990044) | Cod sursa (job #1179616) | Cod sursa (job #1336219) | Cod sursa (job #728084)
Cod sursa(job #728084)
type vect=record
x,y:longint;
end;
var v:array[1..1000000]of vect;
min:real;
i,j,n:longint;
function deca(x1,y1,x2,y2:longint):real;
begin
deca:=sqrt(abs(x1-x2)*abs(x1-x2)+abs(y1-y2)*abs(y1-y2));
end;
begin
assign(input,'cmap.in');reset(input);
assign(output,'cmap.out ');rewrite(output);
read(N);
FOr i:=1 to n do
read(v[i].x,v[i].y);
min:=maxlongint;
for i:=1 to n-1 do
for j:=i+1 to n do
if deca(v[i].x,v[i].y,v[j].x,v[j].y)<min then min:=deca(v[i].x,v[i].y,v[j].x,v[j].y);
write(min:1:6);
close(output);
end.