#标准化矩阵和数据类型选择
acode
void MMN() {
double x1, y1, x2, y2;
double a1, b1, a2, b2;
// Read the coordinates of the first rectangle
scanf("%lf%lf%lf%lf", &x1, &y1, &x2, &y2);
// Read the coordinates of the second rectangle
scanf("%lf%lf%lf%lf", &a1, &b1, &a2, &b2);
// Check if the two rectangles are colliding
double x = x1 < x2 ? x1 : x2;//sma
double X = x1 > x2 ? x1 : x2;//big
double y = y1 < y2 ? y1 : y2;//sma
double Y = y1 > y2 ? y1 : y2;//big //(x,y)&(X,Y)
double a = a1 < a2 ? a1 : a2;//s
double A = a1 > a2 ? a1 : a2;//b
double b = b1 < b2 ? b1 : b2;//s
double B = b1 > b2 ? b1 : b2;//b //(a,b)&(A,B)
if (x < A && X > a && y < B && Y > b) {
//printf("YES\n");
double xX[4] = {x, X, a, A};
bubble_sort(xX, 4);
double yy[4] = {y, Y, b, B};
bubble_sort(yy, 4);
printf("%.2f", (xX[2] - xX[1]) * (yy[2] - yy[1]));
} else {
printf("0.00");nonono
}
}
I'm taken by a nursery rhyme
I want to make a ray of sunshine and never leave home
No amount of coffee
No amount of crying
No amount of whiskey
No amount of wine
No No No No No