Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class PointInTheFigure
- {
- static void Main(string[] args)
- {
- int h = int.Parse(Console.ReadLine());
- int pointX = int.Parse(Console.ReadLine());
- int pointY = int.Parse(Console.ReadLine());
- int x1 = 0;
- int y1 = 0;
- int x2 = 3 * h;
- int y2 = h;
- int secX1 = h;
- int secY1 = 0;
- int secX2 = h * 2;
- int secY2 = h * 4;
- if ((pointX > x1 && pointX < x2) &&
- (pointY > y1 && pointY < y2) ||
- (pointX > secX1 && pointX < secX2) &&
- (pointY > secY1 && pointY < secY2))
- {
- Console.WriteLine("inside");
- }
- else if ((pointX < x1 || pointX > x2) ||
- (pointY < y1 || pointY > y2) &&
- (pointX < secX1 || pointX > secX2) ||
- (pointY < secY1 || pointY > secY2))
- {
- Console.WriteLine("outside");
- }
- else
- {
- Console.WriteLine("border");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment