Res5ec7

Untitled

Apr 7th, 2016
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.82 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 && y>h ) || (x>2*h && y>h) || (x<0) || (x>3*h) || (y<0) || (y>4*h))
  18.             {
  19.                 Console.WriteLine("outside");
  20.             }
  21.             else if ((x>0 && x<3*h && y>0 && y<h) || (x>h && x<2*h && y<4*h && y>0))
  22.             {
  23.                 Console.WriteLine("inside");
  24.             }
  25.             else
  26.             {
  27.                 Console.WriteLine("border");
  28.             }
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment