-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
54 lines (49 loc) · 1.11 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
#include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
#include <cstring>
#include <sstream>
#include <math.h>
#include "dsaLib.h"
#include "dbLib.h"
#include "processData.h"
using namespace std;
int main()
{
clock_t time1=clock();
Initialization();
ifstream fileIn;
fileIn.open("input.txt");
void* pData = nullptr;
void* pOutput = nullptr;
int N;
LoadData(pData);
cout << (double)(clock()-time1)/CLOCKS_PER_SEC << '\n';
assert(pData != nullptr);
cout << fixed << setprecision(8);
string req;
while (true)
{
req = "";
getline(fileIn, req);
if (fileIn.bad())
{
fileIn.clear();
fileIn.ignore(1024, '\n');
continue;
}
if (req == "Exit")
{
break;
}
ProcessRequest(req.data(), pData, pOutput, N);
PrintReqOutput<int>(req.data(), (int*)pOutput, N);
delete [] (int*)pOutput;
pOutput = nullptr;
}
ReleaseData(pData);
Finalization();
cout << (double)(clock()-time1)/CLOCKS_PER_SEC << '\n';
return 0;
}