-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
47 lines (43 loc) · 1.12 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
39
40
41
42
43
44
45
46
47
#include <iostream>
#include "complex.hpp"
using namespace std;
int main() {
Complex the_complex_1(-2, 1);
Complex the_complex_2(1, -1);
the_complex_1.set_Im(9.0);
the_complex_2.set_Re(-3.0);
cout << "1 - ";
the_complex_1.print();
cout << endl;
cout << "2 - ";
the_complex_2.print();
cout << the_complex_1.get_Re() << " " << the_complex_1.get_Im();
cout << endl;
{
Complex the_complex_3 = the_complex_1 + the_complex_2;
cout << "sum - ";
the_complex_3.print();
cout << endl;
}
{
Complex the_complex_3 = the_complex_1 - the_complex_2;
cout << "sub - ";
the_complex_3.print();
cout << endl;
}
{
Complex the_complex_3 = the_complex_1 * the_complex_2;
cout << "mul - ";
the_complex_3.print();
cout << endl;
}
{
Complex the_complex_3 = the_complex_1 / the_complex_2;
cout << "dvn - ";
the_complex_3.print();
cout << endl;
}
return 0;
}
//mkdir build & cd build & cmake -G "MinGW Makefiles" ..
//cmake --build . & complex.exe