Pagini recente » Cod sursa (job #2884891) | Cod sursa (job #162052) | Cod sursa (job #1575555) | Cod sursa (job #985564) | Cod sursa (job #728066)
Cod sursa(job #728066)
type vect=record
x,y:longint;
end;
var v:array[1..100000]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:0:6);
close(output);
end.