SHARE
TWEET

06. Point on Rectangle Border 100/100 if else

Tanina80 Jun 28th, 2016 459 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace _06.Point_on_Rectangle_Border
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             var x1 = double.Parse(Console.ReadLine());
  10.             var y1 = double.Parse(Console.ReadLine());
  11.             var x2 = double.Parse(Console.ReadLine());
  12.             var y2 = double.Parse(Console.ReadLine());
  13.             var x = double.Parse(Console.ReadLine());
  14.             var y = double.Parse(Console.ReadLine());
  15.  
  16.                 if (x>x1 && x<x2 && y>y1 && y < y2) Console.WriteLine("Inside / Outside");
  17.                 else if (x >= x1 && x <= x2 && y == y1) Console.WriteLine("Border");
  18.                 else if (x >= x1 && x <= x2 && y == y2) Console.WriteLine("Border");
  19.                 else if (y >= y1 && y <= y2 && x == x1) Console.WriteLine("Border");
  20.                 else if (y >= y1 && y <= y2 && x == x2) Console.WriteLine("Border");
  21.                 else Console.WriteLine("Inside / Outside");
  22.  
  23.            
  24.                                                                    
  25.          }        
  26.     }
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top