Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _11.Point_In_The_Figure
- {
- class Point_In_The_Figure
- {
- static void Main(string[] args)
- {
- int h = int.Parse(Console.ReadLine().ToLower());
- double xPoint = double.Parse(Console.ReadLine().ToLower());
- double yPoint = double.Parse(Console.ReadLine().ToLower());
- bool isInside = (xPoint < 3 * h && xPoint > 0 && yPoint > 0 && yPoint < h)
- || (xPoint > h && xPoint < 2 * h && yPoint > 0 && yPoint < 4 * h);
- bool isBorder = ((xPoint == 0 && yPoint == 0) || (xPoint == 0 && yPoint <= h && yPoint >= 0)
- || (xPoint <= h && xPoint >= 0 && yPoint == h) || (xPoint == h && yPoint <= 4 * h && yPoint >= 0)
- || (xPoint >= h && xPoint <= 2 * h && yPoint <= 4 * h && yPoint >= 0) || (xPoint >= 2 * h && xPoint <= 3 * h && yPoint == h) || (xPoint == h && yPoint == 0)||(xPoint <= h && xPoint>=0 && yPoint >= 0 && yPoint<=h)||(xPoint>= 2*h && xPoint <= 3*h && yPoint >= 0 && yPoint<=h));
- if (isInside)
- {
- Console.WriteLine("inside");
- }
- else if (isBorder)
- {
- Console.WriteLine("border");
- }
- else
- {
- Console.WriteLine("outside");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement