谁帮我看看我的程序错在哪里了?

来源:百度知道 编辑:UC知道 时间:2024/06/04 23:34:53
#define N 36
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
double x[N],y[N];
void readdat()
{FILE *fr;
int i;
fr=fopen("input.dat","r");
if(fr==NULL)
{printf("File not found!\n");
exit(0);
}
for(i=0;i<N;i++)
{printf("x[%d],y[%d]:",i+1,i+1);

fscanf(fr,"%f",&x[i]);
printf("(%5.3f,",x[i]);

fscanf(fr,"%f",&y[i]);
printf("%5.3f)|",y[i]);
}
printf("End,now close the file.\n");
fclose(fr);
}
double dist(float px,float py,float qx,float qy)
{double d;
d=sqrt((px-qx)*(px-qx)+(py-qy)*(py-qy));
return d;
}
void main()
{ int i,j,c,count;
int k[N];
double r=0,d,dmin=10;
double p[N],q[N];
double X[N],Y[N];
double rx[N],ry[N];

main()
{int a=5,b=7,c=-1; 因为你这里已经定义了一个C,重定义了!
float x=67.8564,y=-789.124;
char c='A';<----重新定义它!
long n=1234567;
unsigned u=65535;
QQ16806008