Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions C++/rectangle-area.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,35 @@
#include <iostream>
#include <algorithm>
#include <cassert>

using namespace std;

class Rectangle {
private:
protected:
int width;
int height;

public:
/*
Rectangle(int w, int h) {
width = w;
height = h;
}
*/

int size() {
return width * height;
}

void Display() {
void display() {
cout << width << " " << height << endl;
}

};

class RectangleArea : public Rectangle {
private:
int width;
int height;

public:
//RectangleArea(int w, int h);

void Input() {
void read_input() {
cin >> width;
cin >> height;
}

void Display() {
void display() {
cout << width * height << endl;
}
};