#include #include #define NUM 5 double dist(double *, double *); void main(void) { int i, j; double p[NUM][2]; double min = 1.0e100; for (i = 0; i < NUM; i++) scanf("%lf %lf", &p[i][0], &p[i][1]); for (i = 0; i < NUM; i++) for (j = i+1; j < NUM; j++) if (min > dist(p[i], p[j])) min = dist(p[i], p[j]); printf("Shortest distance = %lf\n", min); } double dist(double p0[], double p1[]) { return(sqrt((p0[0] - p1[0]) * (p0[0] - p1[0]) + (p0[1] - p1[1]) * (p0[1] - p1[1]))); }