#include<iostream>
#include<cmath>
#include<algorithm>
#include<iomanip>
#define max(a,b) a>b?a:b
#define min(a,b) a<b?a:b
using namespace std;
int main()
{
double arr[2][4];
while (cin >> arr[0][0] >> arr[1][0] >> arr[0][1] >> arr[1][1] >> arr[0][2] >> arr[1][2] >> arr[0][3] >> arr[1][3])
{
if (max(arr[0][0], arr[0][1]) <= min(arr[0][2], arr[0][3]) || (min(arr[0][0], arr[0][1]) >= max(arr[0][2], arr[0][3])) || max(arr[1][0], arr[1][1]) <= min(arr[1][2], arr[1][3]) || (min(arr[1][0], arr[1][1]) >= max(arr[1][2], arr[1][3])))
cout << "0.00" << endl;
else
{
double x;
sort(arr[0], arr[0] + 4);
sort(arr[1], arr[1] + 4);
x = (arr[0][1] - arr[0][2])*(arr[1][1] - arr[1][2]);
cout << setiosflags(ios::fixed) << setprecision(2) << fabs(x) << endl;
}
}
return 0;
}
- 1 回答
- 1 关注
- 1514 浏览
添加回答
举报
0/150
提交
取消