C语言输出了 -1.#IND00.-1.#IND00 这是什么意思
#include<stdio.h>voidmain(){doublex1,x2,x3,x4,y1,y2,y3,y4,a,b,k1,k2,c,d,e,f;printf("i...
# include<stdio.h>
void main()
{
double x1,x2,x3,x4,y1,y2,y3,y4,a,b,k1,k2,c,d,e,f;
printf("input 4 datas");
scanf("%lf %lf %lf% lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4);
a=(x1+x2)/2;
b=(y1+y2)/2;
k1=-1*(x2-x1)/(y2-y1);
c=(x3+x4)/2;
d=(y3+y4)/2;
k2=-1*(x4-x3)/(y4-y3);
e=(d-b+k1*a-k2*c)/(k1-k2);
f=(k1*k2*(c-a)+k2*b-k1*d)/(k2-k1);
printf("%d,%d\n",e,f);
;} 这是原程序 展开
void main()
{
double x1,x2,x3,x4,y1,y2,y3,y4,a,b,k1,k2,c,d,e,f;
printf("input 4 datas");
scanf("%lf %lf %lf% lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4);
a=(x1+x2)/2;
b=(y1+y2)/2;
k1=-1*(x2-x1)/(y2-y1);
c=(x3+x4)/2;
d=(y3+y4)/2;
k2=-1*(x4-x3)/(y4-y3);
e=(d-b+k1*a-k2*c)/(k1-k2);
f=(k1*k2*(c-a)+k2*b-k1*d)/(k2-k1);
printf("%d,%d\n",e,f);
;} 这是原程序 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询