Advertisement
Guest User

Untitled

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