-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
38 lines (31 loc) · 1.2 KB
/
main.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
#include <iostream>
using namespace std;
#include "Member.h"
#include "Member.cpp"
Member avi, beni, chana;
void test1() {
Member dana;
chana.follow(dana);
dana.follow(avi);
cout << " " << chana.numFollowers() << " " << chana.numFollowing() << endl; // 0 1
cout << " " << avi.numFollowers() << " " << avi.numFollowing() << endl; // 1 0
cout << " " << Member::count() << endl; // 4
}
int main() {
cout << avi.numFollowers() << " " << avi.numFollowing() << endl; // 0 0
avi.follow(beni);
cout << avi.numFollowers() << " " << avi.numFollowing() << endl; // 0 1
cout << beni.numFollowers() << " " << beni.numFollowing() << endl; // 1 0
cout << Member::count() << endl; // 3
cout << endl;
avi.follow(beni); // duplicate follow has no effect
cout << avi.numFollowers() << " " << avi.numFollowing() << endl; // 0 1
avi.unfollow(beni);
cout << avi.numFollowers() << " " << avi.numFollowing() << endl; // 0 0
cout << endl;
cout << chana.numFollowers() << " " << chana.numFollowing() << endl; // 0 0
test1();
cout << chana.numFollowers() << " " << chana.numFollowing() << endl; // 0 0
cout << avi.numFollowers() << " " << avi.numFollowing() << endl; // 0 0
cout << Member::count() << endl; // 3
}