using namespace std;
int main() {
double x, y;
cin >> x >> y;
double r = 10.0;
double distanceSquared = x * x + y * y;
bool insideCircle = distanceSquared < r * r;
bool onCircle = abs(distanceSquared - r * r) < 1e-9;
bool aboveLine = y > -x;
bool onLine = fabs(y + x) < 1e-9;
if ( (onCircle && aboveLine) || (onLine && insideCircle) ) {
cout << "На границе" << endl;
} else if (insideCircle && aboveLine) {
cout << "Да" << endl;
} else {
cout << "Нет" << endl;
}
return 0;
}
#include <cmath>
#include <iostream>
using namespace std;
int main() {
constexpr auto rr = 100.0;
constexpr auto eps = 1e-12;
double x, y;
cin >> x >> y;
const auto a = x * x + y * y;
const auto b = y + x;
if (fabs(b) < eps && a <= rr || fabs(a - rr) < eps && 0 <= b) puts("На границе");
else if (rr < a || b < 0) puts("Нет");
else puts("Да");
}
Написать код на с++.