-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
43 lines (39 loc) · 817 Bytes
/
main.cpp
File metadata and controls
43 lines (39 loc) · 817 Bytes
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
#include"Test.h"
using namespace std;
int main() {
#ifdef _DEBUG
_CrtDumpMemoryLeaks();
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
#endif
test();
system("cls");
Frame fmain;
Formula ExpA('a');
Formula ExpX('x');
ExpA.AddToFrame(&fmain);
ExpX.AddToFrame(&fmain);
printf("Formula a;\na:=");
string StrA;
cin >> StrA;
ExpA.Init(StrA);
ExpA.Simplify();
printf("Simplify(a);\n");
ExpA.Print();
printf("Assign a=");
string strVa;
cin >> strVa;
rational va = StringToNum(strVa);
ExpA.Assign(va);
while (1) {
system("cls");
ConsoleOp::gotoxy(0, 0);
cout << "a:\n";
ExpA.Print();
cout << "\nThe value of a is:\n" << ExpA.GetValue() << "\nAssign x= \n";
string strVx;
cin >> strVx;
if (strVx == "quit")return 0;
ExpX.Assign(StringToNum(strVx));
ExpA.Culc();
}
}