Given two rectangles, find the overlapping area of the rectangles. Calculate the area of these two rectangle after remove the overlapping area.
You need to store these information and result in structures:
typedef struct
{
int x;
int y;
int length;
int width;
int leftArea;
} Rect;
For example, if the bottom-left vertices, width and length are (0, 0), 5, 4, and (3, 3), 4, 4 of the first and second rectangle, then the overlapping area is 2. The remaining area of the two rectangle are 18 and 14.
Note that
1. This problem involves three files.
You will be provided with main.c and function.h, and asked to implement function.c.
2. For OJ submission:
Step 1. Submit only your function.c into the submission block. (Please choose c compiler)
Step 2. Check the results and debug your program if necessary.
HINT
function.h
main.c
The bottom-left vertices, width and length of the two rectangle.
The remaining area of the two rectangle, each separated by a space.
Note that you don’t need to print “\n” at the end.