LusienGG

[C#] PointInRectangle

Jun 17th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 KB | None | 0 0
  1. using System;
  2.  
  3. namespace DotInRectangle
  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)
  17.             {
  18.                 Console.WriteLine("Inside");
  19.  
  20.             }
  21.             else
  22.             {
  23.                 Console.WriteLine("Outside");
  24.             }
  25.  
  26.             Console.ReadLine();
  27.  
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment