FZU Problem 2213 Common Tangents

时间:2023-01-07 06:18:31

其实是不太好意思往博客上放的,因为是一道巨水的题,但是我却错了一次,没有判断重合,放上还是为了警示自己,尽量不要在水题上罚时

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main()
{
int t;
int x1,y1,r1,x2,y2,r2;
scanf("%d",&t);
while(t--)
{
scanf("%d%d%d%d%d%d",&x1,&y1,&r1,&x2,&y2,&r2);
int disc = (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1);
int disr1 = r1*r1 + *r1*r2 + r2*r2;
int disr2 = r1*r1 - *r1*r2 + r2*r2;
if(x1==x2 && y1 == y2 && r1 == r2)
puts("-1");
else if(disc > disr1) puts("");
else if(disc == disr1) puts("");
else if(disc < disr1 && disc > disr2) puts("");
else if(disc == disr2) puts("");
else puts("");
}
return ;
}