Pagini recente » Cod sursa (job #2398797) | Cod sursa (job #1668363) | Cod sursa (job #225261) | Cod sursa (job #1957770) | Cod sursa (job #1235786)
#include <cstdio>
#include <cmath>
#define eps 1.e-6
#define INF 1.e9
using namespace std;
class POINT
{
private:
double x,y;
public:
void set(int a,int b)
{
x=a;y=b;
}
double dist(const POINT & other)
{
return sqrt((double)((long long)((long long)x-other.x)*(x-other.x)+(long long)((long long)y-other.y)*(y-other.y)));
}
};
POINT v[100005];
int main()
{
freopen("cmap.in","r",stdin);
freopen("cmap.out","w",stdout);
int n,a,b,i,j;
double d,min=INF;
scanf("%d",&n);
for(i=1;i<=n;++i)
{
scanf("%d%d",&a,&b);
v[i].set(a,b);
}
for(i=1;i<=n;++i)
for(j=i+1;j<=n;++j)
{
d=v[i].dist(v[j]);
if(d<min)
min=d;
}
printf("%lf",min);
return 0;
}