Advertisement
ad2bg

PointInRectangle

Oct 28th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 KB | None | 0 0
  1. namespace PointInRectangle
  2. {
  3.     using System;
  4.  
  5.     class PointInRectangle
  6.     {
  7.         static void Main()
  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.  
  14.             var x = double.Parse(Console.ReadLine());
  15.             var y = double.Parse(Console.ReadLine());
  16.  
  17.  
  18.             if (x>=x1 && x<=x2 && y>=y1 && y<=y2)
  19.             {
  20.                 Console.WriteLine("Inside");
  21.             }
  22.             else
  23.             {
  24.                 Console.WriteLine("Outside");
  25.             }
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement