You are viewing a single comment's thread. Return to all comments →
class Rectangle { public: int width, height; void display() { cout << width << ' ' << height << endl; } }; class RectangleArea : public Rectangle { public: void read_input() { string readinput; getline(cin, readinput); int pos = readinput.find(' '); width = stoi(readinput.substr(0, pos)); height = stoi(readinput.substr(pos + 1)); } void display() { cout << width * height; } };
Seems like cookies are disabled on this browser, please enable them to open this website
Rectangle Area
You are viewing a single comment's thread. Return to all comments →