程序输出的结果不对~帮忙改一下~
13.编一个程序,给出三个圆的圆心和半径,输出谁和谁相交#include "stdio.h"
#include "math.h"
int main()
{double d1,d2,d3,r1,r2,r3,x1,y1,x2,y2,x3,y3;
printf("请分别输入三个圆的圆心坐标和半径(x1,y1) (x2,y2) (x3,y3) r1 r2 r3\n");
scanf("%lf%lf%lf%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3,&r1,&r2,&r3);
d1=sqrt(pow(x1-x2,2)+(y1-y2,2));
d2=sqrt(pow(x1-x3,2)+(y1-y3,2));
d3=sqrt(pow(x3-x2,2)+(y3-y2,2));
if(fabs(r1-r2)<d1<fabs(r1+r2))
printf("圆1与圆2相交\n");
if(fabs(r1-r3)<d2<fabs(r1+r3))
printf("圆1与圆3相交\n");
if(fabs(r2-r3)<d3<fabs(r2+r3))
printf("圆2与圆3相交\n");
else printf("任意两圆都不想交\n");
return 0;
}
输出的结果不对~我是个初学者~