Advertisement
a53

Cercuri

a53
Nov 27th, 2019
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. float r1,x1,y1,r2,x2,y2,d,dif;
  8. cin>>r1>>x1>>y1>>r2>>x2>>y2;
  9. d=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
  10. dif=abs(r1-r2);
  11. if(r1==r2&&x1==x2&&y1==y2)
  12. cout<<"infinit";
  13. else
  14. if(d>r1+r2||d<dif)
  15. cout<<0;
  16. else
  17. if(d==r1+r2||d==dif)
  18. cout<<1;
  19. else
  20. cout<<2;
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement