Advertisement
vasilStanoev

Untitled

Apr 21st, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.17 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Point_in_the_Figure
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var h = int.Parse(Console.ReadLine());
  14.             var x = int.Parse(Console.ReadLine());
  15.             var y = int.Parse(Console.ReadLine());
  16.  
  17.             if ((x > h) && (x < 2 * h) && (y == h)) { Console.WriteLine("inside"); }
  18.             else if ((x >= h) && (x <= 2 * h) && (y >= h) && (y <= 4 * h))
  19.             {
  20.                 if ((x > h) && (x < 2 * h) && (y > h) && (y < 4 * h)) { Console.WriteLine("inside"); }
  21.                 else if ((x >= h) && (x <= 2 * h) || (y >= h) && (y <= 4 * h)) { Console.WriteLine("border"); }
  22.             }
  23.  
  24.             else if ((x >= 0) && (x <= 3 * h) && (y >= 0) && (y <= h))
  25.             {
  26.                 if ((x > 0) && (x < 3 * h) && (y > 0) && (y < h)) { Console.WriteLine("inside"); }
  27.                 else if ((x >= 0) && (x <= 3 * h) || (y >= 0) && (y <= h)) { Console.WriteLine("border"); }
  28.             }
  29.             else { Console.WriteLine("outside"); }
  30.  
  31.  
  32.  
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement