nvnnaidenov

PointInRectangle - Chapter 4.0

Feb 20th, 2022
999
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. //Task 003, Chapter 4.0
  2. using System;
  3.  
  4. public class PointInRectangle
  5. {
  6.     static void Main()
  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.  
  15.         if(x >= x1 && x <= x2 && y >= y1 && y <= y2)
  16.         {
  17.             Console.WriteLine("Inside");
  18.         }
  19.         else
  20.         {
  21.             Console.WriteLine("Outside");
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment