-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
57 lines (53 loc) · 1.01 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
48
49
50
51
52
53
54
55
56
57
#include <iostream>
#include "myFlag.h"
#include "MyFloat.h"
using namespace std;
int main() {
double v1, v2;
cout<<endl<<"Введите число 1: ";
cin>>v1;
cout<<endl<<"Введите число 2: ";
cin>>v2;
MyFloat first(v1);
MyFloat second(v2);
first.print();
second.print();
MyFloat summ;
summ = first + second;
MyFloat resid;
resid = first - second;
MyFloat mult;
mult = first * second;
MyFloat div;
div = first / second;
cout<<endl<<"Sum: ";
summ.print();
cout<<endl<<"Resid: ";
resid.print();
cout<<endl<<"Multi: ";
mult.print();
cout<<endl<<"Div: ";
div.print();
myFlag fl1(v1);
myFlag fl2(v2);
myFlag flSum;
myFlag flRes;
myFlag flMult;
myFlag flDiv;
fl1.print();
fl2.print();
flSum = fl1 + fl2;
flRes = fl1 - fl2;
flMult = fl1 * fl2;
flDiv = fl1 / fl2;
cout<<endl<<endl;
cout<<endl<<"Flag Sum: ";
flSum.print();
cout<<endl<<"Flag Res: ";
flRes.print();
cout<<endl<<"Flag Mult: ";
flMult.print();
cout<<endl<<"Flag Div: ";
flDiv.print();
return 0;
}