📄 2056.cpp
字号:
#include <iostream>
#include <algorithm>
#include <functional>
#include <cmath>
using namespace std;
double x[4], y[4];
double length(double a, double b, double c, double d)
{
if(a > b)
swap(a, b);
if(c > d)
swap(c, d);
if(a > c)
{
swap(a, c);
swap(b, d);
}
if(b > d)
return d - c;
else if(b < c)
return 0;
else
return b - c;
}
int main()
{
while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> x[3] >> y[3])
printf("%.2lf\n", length(x[0], x[1], x[2], x[3]) * length(y[0], y[1], y[2], y[3]));
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -