Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Point_in_Rectangle
- {
- public class Program
- {
- public static void Main()
- {
- double x1 = double.Parse(Console.ReadLine());
- double y1 = double.Parse(Console.ReadLine());
- double x2 = double.Parse(Console.ReadLine());
- double y2 = double.Parse(Console.ReadLine());
- double x = double.Parse(Console.ReadLine());
- double y = double.Parse(Console.ReadLine());
- bool isAsideFromLeft = x >= x1;
- bool isAsideFromRight = x <= x2;
- bool isAsideFromTop = y >= y1;
- bool isAsideFromBottom = y <= y2;
- if ((x == x1 || x == x2) && isAsideFromTop && isAsideFromBottom || (y == y1 || y == y2) && isAsideFromLeft && isAsideFromRight)
- {
- Console.WriteLine("Border");
- }
- else Console.WriteLine("Inside / Outside");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement