求两圆的位置关系
1代表相切,2代表相离,3代表包含,4代表相交帮忙看一下哪里错了,谢谢
#include<stdio.h>
#include<math.h>
int main()
{
double x1,x2,y1,y2,r1,r2,d;
while(scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&r1,&r2)!=EOF)
{
d=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
if(d>r1+r2)
printf("2\n");
else if(d==r1+r2||d==fabs(r1-r2))
printf("1\n");
else if(d<r1+r2&&d>fabs(r1-r2))
printf("4\n");
else
printf("3\n");
}
return 0;
}