Advertisement
Ar3mida

k_2

Nov 2nd, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. bool IsPointInCircle(double x, double y, double xc, double yc, double r) {
  7.     return abs(x - xc)*abs(x - xc) + abs(y - yc)*abs(y - yc) <= r*r;
  8. }
  9.  
  10. int main() {
  11.     double  x, y, xc, yc, r;
  12.     cin >> x >> y >> xc >> yc >> r;
  13.     if (IsPointInCircle(x, y, xc, yc, r)) {
  14.         cout << "YES";
  15.     }
  16.     else
  17.         cout << "NO";
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement