Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Rectangle {
- public:
- int width, height;
- void Display() {
- cout << width << " " << height << endl;
- }
- };
- class RectangleArea: public Rectangle {
- public:
- void Input() {
- cin >> width >> height;
- }
- void Display() {
- cout << width * height << endl;
- }
- };
- int main()
- {
- RectangleArea r_area;
- r_area.read_input();
- r_area.Rectangle::display();
- r_area.display();
- return 0;
- }
Add Comment
Please, Sign In to add comment