Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace PointAtRectangularSide
- {
- class Program
- {
- static void Main(string[] args)
- {
- var x1 = double.Parse(Console.ReadLine());
- var y1 = double.Parse(Console.ReadLine());
- var x2 = double.Parse(Console.ReadLine());
- var y2 = double.Parse(Console.ReadLine());
- var x = double.Parse(Console.ReadLine());
- var y = double.Parse(Console.ReadLine());
- var checkx = (x == x1 || x == x2);
- var checky = (y == y1 || y == y2);
- var checkxrange = (x >= x1) && (x <= x2);
- var checkyrange = (y >= y1) && (y <= y2);
- if ( (checkx && checkxrange && checkyrange)
- ||
- (checky && checkyrange && checkxrange) )
- {
- Console.WriteLine("Border");
- }
- else Console.WriteLine("Inside / Outside");
- }
- }
- }
- /* var x1 = double.Parse(Console.ReadLine());
- var y1 = double.Parse(Console.ReadLine());
- var x2 = double.Parse(Console.ReadLine());
- var y2 = double.Parse(Console.ReadLine());
- var x = double.Parse(Console.ReadLine());
- var y = double.Parse(Console.ReadLine());
- {
- if (((x == x1 || x == x2) &&
- (y >= y1) && (y <= y2))
- ||
- ((y == y1 || y == y2) &&
- (x >= x1) && (x <= x2)))
- {
- Console.WriteLine("Border");
- }
- else Console.WriteLine("Inside / Outside");
- }
- }
- }
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment