Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- double x,y,r,temp;
- cin>>x>>y;
- r=sqrt(x*x+y*y);
- if(x>=-14&&x<=14&&y>=14){cout<<y-14;}
- if(x>=0&&x<=14&&y<=-14){cout<<sqrt(y*y)-14;}
- if(x>=14&&y<=14&&y>=-14){cout<<x-14;}
- if(y<=14&&y>=0&&x<=-14){cout<<sqrt(x*x)-14;}
- if(y<0&&x<0){if(y>-5&&x>-5){temp=min(x,y);cout<<7-sqrt(temp*temp);}else{cout<<r-14;}}
- if(sqrt(x*x)>14&&sqrt(y*y)>14){cout<<r-sqrt(14*14);}
- if(x>-7&&x<7&&y>-7&&y<7){cout<<7-r;}
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment