[求助]程序出错!
#include<math.h>#define N 50
int i,j,n;
float C[N],L[N];
float yx,yy,r1,r;
float Yx,Yy,R1,R;
float circlex,circley,radius;
print(float yx,float yy,float r)
{
if(radius>r)
{radius=r;
circlex=yx;
circley=yy;}
else return 0;
printf("circlex is %f circley is %f radius is %f",circlex,circley,radius);
}
search(float yx,float yy,float r1,float r)
{
for(i=0;i<n;i++)
{if((L[i]-yx)*(L[i]-yx)+(C[i]-yy)*(C[i]-yy)>r1)
break;
else
radius=r;
print(yx,yy,r);
}
return 0;
}
math()
{
while(1)
for(i=0;i<n-1;i++)
{for(j=1;j<n;j++)
{Yx=(L[i]+L[j])/2;
Yy=(C[i]+C[j])/2;
R1=(L[j]-L[i])*(L[j]-L[i])+(C[i]-C[j])*(C[i]-C[j]);
R=sqrt(R1)/2;
search(Yx,Yy,R1,R);
}
}
}
main()
{
printf("please input point number");
scanf("%d",&n);
for(i=0;i<n;i++)
{printf("please input point i的x坐标,y坐标");
scanf("%f %f",&L[i],&C[i]);
}
math();
}
这个程序编译都没错.但运行时会出现overflow不知道为什么.请大家帮忙看下.