Advertisement
Guest User

1

a guest
Sep 18th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. struct cr{
  4. int x,y,r;
  5. };
  6. int main(){
  7. cr a,b;
  8. double d;
  9. cin>>a.x>>a.y>>a.r;
  10. cin>>b.x>>b.y>>b.r;
  11. d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);
  12. if(a.x==b.x && a.y==b.y && a.r==b.r)
  13. cout<<-1;
  14. else
  15. if((a.r+b.r)*(a.r+b.r)==d || (a.r-b.r)*(a.r-b.r)==d)
  16. cout<<1;
  17. else
  18. if((a.r+b.r)*(a.r+b.r)<d || (a.r-b.r)*(a.r-b.r)>d)
  19. cout<<0;
  20. else
  21. cout<<2;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement