-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathe4.cpp
55 lines (45 loc) · 783 Bytes
/
e4.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <iostream>
using namespace std;
class VerBar {
public:
VerBar(int n) : _n(n) {
for (int i = 1; i <= _n; i++)
cout << "|" << endl;
}
private:
int _n;
};
class HorBar {
public:
HorBar(int n) : _n(n) {
cout << "+";
for (int i = 1; i <= _n; i++)
cout << "-";
cout << "+" << endl;
}
private:
int _n;
};
class Frame {
public:
Frame(int hor, int ver) : _up(hor), _down(hor), _mid(ver) {}
private:
HorBar _up;
VerBar _mid;
HorBar _down;
};
class Ladder {
public:
Ladder(int hor, int ver)
: _ver(ver), _hor(hor), _up(_hor, _ver), _mid(_ver), _down(_hor, _ver) {}
private:
int _hor;
int _ver;
Frame _up;
VerBar _mid;
Frame _down;
};
int main(int argc, char const *argv[]) {
Ladder lad(5, 2);
return 0;
}