Laitofai

BQ | Разветвл. алгоритмы

Nov 28th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int x,y;
  9.     cin>>x>>y;
  10.     if(x>0||sqrt(x*x)>20)
  11.         {cout<<"NO";}
  12.         else{
  13.             if(sqrt(y*y)>20)
  14.                 {cout<<"NO";}
  15.             else{
  16.                     if(y>0){
  17.                         if(sqrt(x*x+y*y)<10)
  18.                             {cout<<"NO";}
  19.                             else{cout<<"YES";}
  20.                     }else{
  21.                 if(x>-10&&y>-10){cout<<"NO";}else{if(sqrt(x*x+y*y)>20){cout<<"NO";}else{cout<<"YES";}}
  22.             }
  23.         }
  24.     }
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment