题解 | #比较长方形的面积大小#
比较长方形的面积大小
https://www.nowcoder.com/practice/61e0c4069baf474db635cd492ac9ba9c
#include<bits/stdc++.h> using namespace std; class rectangle { private: int length,width; public: rectangle (int l,int h){length=l;width=h;} double area(); }; double rectangle::area(){return length*width;} int main() {int l,h,x,y; cin>>l>>h>>x>>y; rectangle m(l,h);rectangle n(x,y); if(m.area()>n.area())cout<<1; else cout<<0; }