Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int x1, y1, r1, x2, y2, r2;
  6. cout << "Input integer XCoord,YCoord and radius of the first circle:";
  7. cin >> x1>>y1>>r1;
  8.  
  9. cout << "Input integer XCoord,YCoord and radius of the second circle:";
  10. cin >> x2 >> y2 >> r2;
  11.  
  12. int exp = (x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2);
  13.  
  14. if (exp < (r1 + r2)*(r1 + r2))
  15. {
  16. cout << "The circles intersect at more than one point.";
  17. }
  18. else if (exp == (r1 + r2)*(r1 + r2))
  19. {
  20. cout << "The circles intersect at one point.";
  21. }
  22. else
  23. {
  24. cout << "The circles do not intersect.";
  25. }
  26.  
  27. while (true) {};
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement