//
// Created by 刘彪 on 2020/2/29.
//
#include <iostream>
#include <iomanip>
#include <cstdio>
using namespace std;
class Rect {
int x,y;
int w,h;
public:
Rect(int x1,int y1,int w1,int h1){
x = x1;y = y1;
w = w1;h = h1;
}
void Move(int x1,int y1){x=x1;y=y1;}
void Size(int w1,int h1){w=w1;h=h1;}
void Where(int &x1,int &y1){x1 = x;y1=y;}
int Area(){return w*h;}
};
int main(){
Rect r(2,3,20,10);
int x,y;
cout<<"矩形面积:"<<r.Area()<<endl;
cout<<"移动到(5,4)"<<endl;
r.Move(5,4);
cout<<"改变宽为6,高为3"<<endl;
r.Size(6,3);
r.Where(x,y);
cout<<"左上角:("<<x<<","<<y<<")"<<endl;
cout<<"矩形面积:"<<r.Area()<<endl;
return 0;
}
//p118