Eu consegui fazer já ...
Segue codigo ...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int main()
{
int tamanho;
FILE *fp;
fp = fopen("trembala.dat","r");
if (fp == NULL){
printf("\nError.");
system("PAUSE");
}else{
printf("\nO arquivo trembala.dat foi aberto.");
printf("\n");
do{
fscanf(fp, "%d", &tamanho);
int coorX[tamanho];
int coorY[tamanho];
int i, k;
printf("\n");
for(i = 0; i< tamanho; i++){
fscanf(fp, "%d", &coorX);
}
for(k = 0; k< tamanho; k++){
fscanf(fp, "%d", &coorY[k]);
}
double aux = 199999;
int auxA = 0;
int auxB = 0;
double valor;
for(i = 0; i < tamanho; i++){
for(k = i+1; k< tamanho; k++){
int a,b,c,d;
a = coorX;
b = coorX[k];
c = coorY[k];
d = coorY;
valor = sqrt(pow(b-a,2)+pow(c-d,2));
if(valor<aux){
aux = valor;
auxA = i+1;
auxB = k+1;
}
}
}
if(tamanho!=0){
printf("%d %d %.2f", auxA, auxB, aux);
}
}while(tamanho!=0);
}
printf("\n\nFechando o arquivo trembala.dat\n\n");
fclose(fp);
return 0;
}
Obrigado