-1
#include <iostream>
using namespace std;

class Room
{
    public:
        int length,
            width,
            number,
            Area2;

    public:
        Room(int l = 600, int w = 1000, int r = 6, int a)
        {
            length = l;
            width = w;
            number = r;
            Area2 = a;
        }

        int getArea()
        {
            return length * width;
        }
};

class House
{
    public:
        int len,
            wid;
        Room r1;

    public:
        House(int ll = 20, int ww = 60, int r = 6)
            : r1(r)
        {
            len = ll;
            wid = ww;
        }

        int Room_function()
        {
            int Area1, Area2, r;
            Area1 = Area2 * r;
            cout << "total area of the house:" << Area1;
            r1.getArea(Area2);
        }
};

int main()
{

    int l, w, r, a;
    Room r3();
    a = r3.getArea();
    cout << "Area of one Room:" << Area2 << endl;
    int l1, w1;
    House h1();
    h1.r1.getArea(Area2);
    h1.Room_function();


    system("PAUSE");
    return 0;
}
4

3 に答える 3