Prog Problem1 needed help can find the solution

[The Problem]
Given a set of points in a two dimensional space, you will have to find the distance between the
closest two points.

[Input]
The input file contains several sets of input. Each set of input starts with an integer N (0 <= N
<=10000), which denotes the number of points in this set. The next N line contains the
coordinates of N two-dimensional points. The first of the two numbers denotes the X-coordinate
and the latter denotes the Y-coordinate. The input is terminated by a set whose N = 0. This set
should not be processed. The value of the coordinates will be less than 40000 and non-negative.

[Output]
For each set of input produce a single line of output containing a floating point number (with
four digits after the decimal point) which denotes the distance between the closest two points. If
there is no such two points in the input whose distance is less than 10000, print the line
INFINITY.

--> I really needed help please help me T-T
I really needed help

Past tense ...

The purpose of a homework is that you do learn (something). Therefore, you should show us all the code that you have written so far. If you have written nothing, nor even formed any general idea what you should do, then we have no incentive to be helpful nor expect that you would understand our responses.

Read one set at a time, find the nearest pair for a set, and show that distance. Outer set-loop, inner input-loop, nested pair of loops to find the nearest pair & output minimum with a condition.

You do know how to compute distance, don't you?
So sorry i only posted this because of i really need help from the best and my teacher give this ahead of our lesson. I think this problem should be on December or January. So i want to know how to work this thing. T-T
Topic archived. No new replies allowed.