#include <iostream>
using namespace std;
class Rect
{
private:
int w;
int h;
public:
void init(int n1,int n2);
int set_w();
int set_h();
void show();
};
void Rect::init(int n1, int n2)
{
w = n1;
h = n2;
}
int Rect::set_w()
{
return w;
}
int Rect::set_h()
{
return h;
}
void Rect::show()
{
cout << "周长:" << (h+w)*2 << endl;
cout << "面积:" << w*h << endl;
}
void show(Rect r1)
{
cout << "周长:" << (r1.set_h()+r1.set_w())*2 << endl;
cout << "面积:" << r1.set_w()*r1.set_h() << endl;
}
int main()
{
Rect r1;
r1.init(5,12);
r1.show();
return 0;
}