Advertisement
Kuncavia

13. PointInTheFigure

Nov 27th, 2016
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.76 KB | None | 0 0
  1. using System;
  2.  
  3. class PointInTheFigure
  4. {
  5.     static void Main(string[] args)
  6.     {
  7.         var h = int.Parse(Console.ReadLine());
  8.         var x = int.Parse(Console.ReadLine());
  9.         var y = int.Parse(Console.ReadLine());
  10.         string result = "";
  11.         if ((x > 0 && x < (3 * h) && y > 0 && y < h))
  12.         {
  13.             result = "inside";
  14.         }
  15.         else if ((x > h && x < (2 * h) && y >= h && y < (4 * h)))
  16.         {
  17.             result = "inside";
  18.         }
  19.         else if (!(x >= 0 && x <= (3 * h) && y >= 0 && y <= h) && !(x >= h && x <= (2 * h) && y >= h && y <= (4 * h)))
  20.         {
  21.             result = "outside";
  22.         }
  23.         else
  24.         {
  25.             result = "border";
  26.         }
  27.         Console.WriteLine(result);
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement