fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6. double x, y;
  7. cout << "Введите значения x и y: ";
  8. cin >> x >> y;
  9.  
  10. bool p = false;
  11.  
  12.  
  13. if (x * x + y * y <= 1) {
  14.  
  15. if (x + y >= 0 && x + y <= 1)
  16. p = true;
  17.  
  18. else if (x <= 0 && y >= 0) {
  19.  
  20. if (y - x >= 0 && y - x <= 1)
  21. p = true;
  22. }
  23. else if (x <= 0 && y <= 0) {
  24.  
  25. if (-(x + y) >= 0 && -(x + y) <= 1)
  26. p = true;
  27. }
  28. else {
  29.  
  30. if (y + x >= 0 && y + x <= 1)
  31. p = true;
  32. }
  33. }
  34.  
  35.  
  36. if (p)
  37. cout << "ДА" << endl;
  38. else
  39. cout << "НЕТ" << endl;
  40.  
  41. return 0;
  42. }
Success #stdin #stdout 0.01s 5304KB
stdin
1
2
10
42
11
stdout
Введите значения x и y: НЕТ