Advertisement
nikolayyankov

Point on Rectangle Border

May 27th, 2017
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.95 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.             var x1 = Double.Parse(Console.ReadLine());
  14.             var y1 = Double.Parse(Console.ReadLine());
  15.             var x2 = Double.Parse(Console.ReadLine());
  16.             var y2 = Double.Parse(Console.ReadLine());
  17.             var x = Double.Parse(Console.ReadLine());
  18.             var y = Double.Parse(Console.ReadLine());
  19.  
  20.             if (x == x1 || x == x2 && y > y1 && y < y2)
  21.             {
  22.                 Console.WriteLine("Border");
  23.             }
  24.             else if (y == y1 || y == y2 && x > x1 && x < x2)
  25.             {
  26.                 Console.WriteLine("Border");
  27.  
  28.             }
  29.             else
  30.             {
  31.                 Console.WriteLine("Inside / Outside");
  32.  
  33.             }
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement