Advertisement
Kuncavia

06. PointOnRectangleBorder

Nov 27th, 2016
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. using System;
  2.  
  3. class PointOnRectangleBorder
  4. {
  5.     static void Main(string[] args)
  6.     {
  7.         double x1 = double.Parse(Console.ReadLine());
  8.         double y1 = double.Parse(Console.ReadLine());
  9.         double x2 = double.Parse(Console.ReadLine());
  10.         double y2 = double.Parse(Console.ReadLine());
  11.         double x = double.Parse(Console.ReadLine());
  12.         double y = double.Parse(Console.ReadLine());
  13.  
  14.         if ((x > x1 && x < x2 && y > y1 && y < y2) || ((x < x1 || y < y1 || x > x2 || y > y2)))
  15.             Console.WriteLine("Inside / Outside");
  16.         else
  17.             Console.WriteLine("Border");
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement