⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 2056.cpp

📁 杭电 acm部分代码 有兴趣的可以下载 谢谢
💻 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 + -