Example: Point on a Rectangle Side

Write a program that checks whether a point {x, y} is placed onto any of the sides of a rectangle {x1, y1} - {x2, y2}. The input data is read from the console and consists of 6 rows: the decimal numbers x1, y1, x2, y2, x and y (as it is garanteed that x1 < x2 and y1 < y2). Print "Border" (if the point lies on any of the sides) or "Inside / Outside" (in the opposite case).

Sample Input and Output

Input Output Input Output
2
-3
12
3
12
-1
Border 2
-3
12
3
8
-1
Inside / Outside

results matching ""

    No results matching ""