在这里插入代码片
```#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define Max(a,b) ((a)>(b)?(a):(b))
#define Min(a,b) ((a)<(b)?(a):(b))
int main()
{
double x1,y1,x2,y2; //第一个矩形
double x3,y3,x4,y4; //第二个矩形
scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2);
scanf("%lf%lf%lf%lf",&x3,&y3,&x4,&y4);
double a1,b1;
double a2,b2;
a1 = Min(Max(x1,x2),Max(x3,x4));
b1 = Min(Max(y1,y2),Max(y3,y4));
a2 = Max(Min(x1,x2),Min(x3,x4));
b2 = Max(Min(y1,y2),Min(y3,y4));
double area = (a1-a2)*(b1-b2);
if(b1 <= b2 || a2 >= a1 ) //或是关键哦两种情况要注意
printf("0.00");
else
printf("%.2lf",area);
return 0;
}
09-03