hdu 的 2056 求矩形相交面积 !!球告知哪里错了,射射!
#include<stdio.h>double max(double a,double b)
{return a>b?a:b;}
double min(double a,double b)
{return a<b?a:b;}
int main()
{
double x1,y1,x2,y2,x3,y3,x4,y4;
double s;
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4)!=EOF)
{
if((min(x2,x4)-max(x1,x3)>=0)&& (min(y2,y4)-max(y1,y3)>=0))
{
s=(min(x2,x4)-max(x1,x3))* (min(y2,y4)-max(y1,y3));
printf("%.2lf\n",s);
}
else
printf("0.00\n");
}
return 0;
}
数据测试是对的 但是提交wa 求助哪里错了 射射!!