MiroslavKisov

Point_In_Rectangle_Border

Jul 26th, 2017
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.98 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_On_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.             if ((x == x1 || x == x2) && (y >= y1 && y <= y2))
  20.             {
  21.                 Console.WriteLine("Border");
  22.             }
  23.             else if ((y == y1 || y == y2) && (x >= x1 && x <= x2))
  24.             {
  25.                 Console.WriteLine("Border");
  26.             }
  27.             else
  28.             {
  29.                 Console.WriteLine("Inside / Outside");
  30.             }
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment