Laitofai

3 | Кристина | Разв. алгоритмы

Dec 6th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.20 KB | None | 0 0
  1. /*
  2.     Вариант 9
  3.     Задача 3
  4.  
  5. */
  6. #include <iostream>
  7. #include <math.h>
  8.  
  9. using namespace std;
  10.  
  11. int main()
  12. {
  13.     double x, y, r;
  14.     cin >> x >> y;
  15.     r = sqrt(x * x + y * y);
  16.     if(y >= 0){
  17.         if(r > 20){
  18.             cout << "NO" << endl;
  19.         }else{
  20.             if(x >= 0){
  21.                 if(r < 10){
  22.                     cout << "NO" << endl;
  23.                 }else{
  24.                     cout << "YES" << endl;
  25.                 }
  26.             }else{
  27.                 if(x > -10 && y < 10){
  28.                     cout << "NO" << endl;
  29.                 }else{
  30.                     cout << "YES" << endl;
  31.                 }
  32.             }
  33.         }
  34.     }else{
  35.         if(y < -20 || (x > 20 || x < -20)){
  36.             cout << "NO" << endl;
  37.         }else{
  38.             if(x >= 0){
  39.                 if(x < 10 && y > -10){
  40.                     cout << "NO" << endl;
  41.                 }else{
  42.                     cout << "YES" << endl;
  43.                 }
  44.             }else{
  45.                 if(r < 10){
  46.                     cout << "NO" << endl;
  47.                 }else{
  48.                     cout << "YES" << endl;
  49.                 }
  50.             }
  51.         }
  52.     }
  53.     return 0;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment