Guest User

Untitled

a guest
Jan 26th, 2017
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.14 KB | None | 0 0
  1. using System;
  2.  
  3. class PointFigure
  4. {
  5.     static void Main()
  6.     {
  7.         var h = int.Parse(Console.ReadLine());
  8.         var x = int.Parse(Console.ReadLine());
  9.         var y = int.Parse(Console.ReadLine());
  10.         if ((x > h) & (x < 2 * h) & (y == h))
  11.         {
  12.             Console.WriteLine("inside");
  13.         }
  14.         else if ((x >= h) & (x <= 2 * h) & (y >= h) & (y <= 4 * h))
  15.         {
  16.             if ((x > h) & (x < 2 * h) & (y > h) & (y < 4 * h))
  17.             {
  18.                 Console.WriteLine("inside");
  19.             }
  20.             else if ((x >= h) & (x <= 2 * h) || (y >= h) & (y <= 4 * h))
  21.             {
  22.                 Console.WriteLine("border");
  23.             }
  24.         }
  25.  
  26.         else if ((x >= 0) & (x <= 3 * h) & (y >= 0) & (y <= h))
  27.         {
  28.             if ((x > 0) & (x < 3 * h) & (y > 0) & (y < h))
  29.             {
  30.                 Console.WriteLine("inside");
  31.             }
  32.             else if ((x >= 0) & (x <= 3 * h) || (y >= 0) & (y <= h))
  33.             {
  34.                 Console.WriteLine("border");
  35.             }
  36.         }
  37.         else
  38.         {
  39.             Console.WriteLine("outside");
  40.         }
  41.     }
  42. }
Add Comment
Please, Sign In to add comment