#include <iostream>
using namespace std;

class Rectangle
{
private:
    int width;
    int height;

public:
    void SetData(int w, int h)
    {
        width = w;
        height = h;
    }

    int GetArea()
    {
        return width * height;
    }

    int GetPerimeter()
    {
        return 2 * (width + height);
    }

    void Show()
    {
        cout << "넓이: " << GetArea() << endl;
        cout << "둘레: " << GetPerimeter() << endl;
    }
};

int main()
{
    Rectangle rec;
    rec.SetData(5, 4);
    rec.Show();

    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: