Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- class Program
- {
- static void Main()
- {
- int h = int.Parse(Console.ReadLine());
- int x = int.Parse(Console.ReadLine());
- int y = int.Parse(Console.ReadLine());
- //check if the point is inside the figure
- if ((x>h&&x<2*h&&y>h&&y<4*h) || (x>0&&x<3*h&&y>0&&y<h)||(y==h&&x>h&&x<2*h))
- {
- Console.WriteLine("inside");
- }
- //check if the point is on the border
- else if ((x>=h&&x<=2*h&&y==4*h)||((y>=h&&y<=4*h)&&(x==h||x==2*h))||((x>=0&&x<=3*h))&&(y==0||y==h)||(y>=0&&y<=h)&&(x==0||x==3*h))
- {
- Console.WriteLine("border");
- }
- //if not inside or a border, it's outside:
- else
- {
- Console.WriteLine("outside");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement