单单单


私信TA

用户名:shanjiangyi

访问量:2734

签 名:

题解只是用来保存代码的, 如果有人看到重复什么的,见谅见谅啦

等  级
排  名 34590
经  验 403
参赛次数 0
文章发表 3
年  龄 0
在职情况 学生
学  校 南昌航空大学
专  业

  自我简介:

解题思路:





注意事项:





参考代码:

#define _CRT_SECURE_NO_DEPRECATE

#define MAXN 10000

#include <stdio.h>

#include <iostream>

#include <string.h>

#include <string>

#include <math.h>

#include <algorithm>

using namespace std;

int main() {

double x[4], y[4];

for (int i = 0; i < 4; i++) {

scanf("%lf%lf", &x[i], &y[i]);

}

sort(x, x + 2);

sort(x + 2, x + 4);

sort(y, y + 2);

sort(y + 2, y + 4);

if (x[1] <= x[2] || x[0] >= x[3] || y[1] <= y[2] || y[0] >= y[3]) {

printf("0.00\n");

}

else {

sort(x, x + 4);

sort(y, y + 4);

printf("%.2f\n", (x[2] - x[1]) * (y[2] - y[1]));

}

return 0;

}


 

0.0分

0 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区