#include <iostream>
using namespace std;
bool is_point_in_circle(double x, double y, double xc, double yc, double r);
int main()
{
double x, y, xc, yc, r;
bool result;
cin >> x >> y >> xc >> yc >> r;
result = is_point_in_circle(x, y, xc, yc, r);
if (result) cout << "YES";
else cout << "NO";
return 0;
}
bool is_point_in_circle(double x, double y, double xc, double yc, double r)
if ((x - xc) * (x - xc) + (y - yc) * (y - yc) < r * r) return true;
return false;
Поделитесь своими знаниями, ответьте на вопрос:
Напиши эту блок-схему, если х=8 до 11 часов
#include <iostream>
using namespace std;
bool is_point_in_circle(double x, double y, double xc, double yc, double r);
int main()
{
double x, y, xc, yc, r;
bool result;
cin >> x >> y >> xc >> yc >> r;
result = is_point_in_circle(x, y, xc, yc, r);
if (result) cout << "YES";
else cout << "NO";
return 0;
}
bool is_point_in_circle(double x, double y, double xc, double yc, double r)
{
if ((x - xc) * (x - xc) + (y - yc) * (y - yc) < r * r) return true;
return false;
}