Created
June 17, 2016 07:55
-
-
Save Anupam02/8f049d3e8a2211e51b30a4fbb791d41a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| using namespace std; | |
| inline int checkThePoint(int a, int x, int y) { | |
| if(x > 0 && x < a && y > 0 && y < a) return 0;; | |
| if(((x == 0 || x == a) && ( y >= 0 && y <= a)) || ((y == 0 || y == a) && ( x >= 0 && x <= a))) return 1; | |
| return 2; | |
| } | |
| int main() { | |
| int a,x,y; | |
| cin>>a>>x>>y; | |
| cout<<checkThePoint(a,x,y)<<endl; | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment