解题思路:
注意事项:
参考代码:
#include<iostream> #include<iomanip> using namespace std; int main() { double x1,y1,x2,y2,x3,y3,x4,y4; cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; double x5,y5,x6,y6; x6=min(max(x1,x2),max(x3,x4)); y6=min(max(y1,y2),max(y3,y4)); x5=max(min(x1,x2),min(x3,x4)); y5=max(min(y1,y2),min(y3,y4)); double a; if((x6>x5)&&(y6>y5)) { a=(x6-x5)*(y6-y5); cout<<fixed<<setprecision(2)<<a; } else cout<<fixed<<setprecision(2)<<0.00; return 0; }
0.0分
1 人评分