Home > Back-end >  The small white for help
The small white for help

Time:10-22

Must be C:
Two-dimensional planar point (x, y) coordinates, said input rectangular coordinates, the upper left corner and lower right to enter a point, determine whether the point within the given rectangle (including rectangular edge),

Input:

The first line: at the upper left of the rectangular coordinates,

The second line: rectangular coordinates of the lower right corner

The third line: ren point coordinates

Output: if which fall within the rectangle, output IN, otherwise, the output OUT

The sample input:
10 20
30 0
40-10

The sample output:
OUT

CodePudding user response:

Top of the Monash

CodePudding user response:

For example
Int main () {
Int x1, y1, x2, y2, x, y;
The scanf (" % d % d ", & amp; X1, & amp; Y1);
The scanf (" % d % d ", & amp; X2, & amp; Y2);
The scanf (" % d % d ", & amp; X, & amp; Y);
If (x X2 | | y Y2)
Printf (" OUT ");
The else
Printf (" IN ");
return 0;
}
  • Related