Write a class having two private variables defining a rectangle, and a member function which will return the area of the rectangle.
Write a class having two private variables defining a rectangle, and a member function which will return the area of the rectangle.
the type of variables is int.
输入
5 4
输出
20
The main function is provided, you only need to complete the Rectangle Class:
int main(){
int length,width;
cin>> length>>width;
Rectangle rect;
rect.setLength(length);
rect.setWidth(width);
cout<<rect.returnArea()<<endl;
}