Skip to content

Instantly share code, notes, and snippets.

@Anupam02
Created June 17, 2016 07:55
Show Gist options
  • Select an option

  • Save Anupam02/8f049d3e8a2211e51b30a4fbb791d41a to your computer and use it in GitHub Desktop.

Select an option

Save Anupam02/8f049d3e8a2211e51b30a4fbb791d41a to your computer and use it in GitHub Desktop.
#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