-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
44 lines (40 loc) · 1.19 KB
/
Copy pathmain.cpp
File metadata and controls
44 lines (40 loc) · 1.19 KB
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
#include "StringType.h"
using namespace std;
int main()
{
// string s;
// string p;
// cin >> s >> p;
// const char* sc = s.c_str();
// const char* pc = p.c_str();
// StringType str(sc);
// StringType pattern(pc);
// cout << like(str, pattern, '\\', true) << endl;
// cout << Like(pattern).match(str) << endl;
// cout << stack_like(str, pattern) << endl;
// std::string m_str = str.get_str();
ifstream in;
ofstream out;
in.open("tests.txt");
std::string sc, pc;
StringType str, pattern;
bool res;
clock_t work_time;
while(!in.eof()){
in >> sc >> pc >> res;
str = StringType(sc);
pattern = StringType(pc);
work_time = clock();
if(like(str, pattern) != res)
cout << "Fail!" << " ";
work_time = clock() - work_time;
cout << "Rec time: " << (double)work_time/CLOCKS_PER_SEC << endl;
if(stack_like(str, pattern) != res)
cout << "Fail!" << " ";
work_time = clock() - work_time;
cout << "Stack time: " << (double)work_time/CLOCKS_PER_SEC << endl;
cout << endl;
}
in.close();
return 0;
}