Advertisement
Qrist

Point in a Rectangle

Apr 13th, 2020
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.60 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5.  
  6.     static void Main(string[] args)
  7.     {
  8.         double x1 = double.Parse(Console.ReadLine());
  9.         double y1 = double.Parse(Console.ReadLine());
  10.         double x2 = double.Parse(Console.ReadLine());
  11.         double y2 = double.Parse(Console.ReadLine());
  12.         double x = double.Parse(Console.ReadLine());
  13.         double y = double.Parse(Console.ReadLine());
  14.         if (x >= x1 && x <= x2 && y >= y1 && y <= y2)
  15.         {
  16.             Console.WriteLine("Inside");
  17.         }
  18.         else
  19.         {
  20.             Console.WriteLine("Outside");
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement