这道题一定要注意题目中长不一定大于宽的条件,需要有两种情况进行判断 #include<bits/stdc++.h> using namespace std; class rectangle{ private: int length,width; public: void set(int x,int y){ length=x; width=y; } int getlength(){ return length; } int getwidth(){ return width; } int area(){ return length*width; } // write your code...