Advertisement
Guest User

Untitled

a guest
May 14th, 2016
2,103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.22 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 Rectangle_Border
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double x1 = double.Parse(Console.ReadLine());
  14.             double y1 = double.Parse(Console.ReadLine());
  15.             double x2 = double.Parse(Console.ReadLine());
  16.             double y2 = double.Parse(Console.ReadLine());
  17.             double x = double.Parse(Console.ReadLine());
  18.             double y = double.Parse(Console.ReadLine());
  19.  
  20.             var onLeftSide = (x == x1) && (y >= y1) && (y <= y2);
  21.             var onRightSide = (x == x2) && (y >= y1) && (y <= y2);
  22.             var onUpSide = (y == y1) && (x >= x1) && (x <= x2);
  23.             var onDownSide = (y == y2) && (x >= x1) && (x <= x2);
  24.             if (onLeftSide || onRightSide || onUpSide || onDownSide)
  25.             {
  26.                 Console.WriteLine("Border");
  27.             }
  28.  
  29.             else
  30.             {
  31.                 Console.WriteLine("Inside / Outside");
  32.             }
  33.         }
  34.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement