-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
35 lines (28 loc) · 708 Bytes
/
main.cpp
File metadata and controls
35 lines (28 loc) · 708 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
#include <iostream>
#include "Finder.hpp"
/**
* open file, create finder to read all information and create bor
*
* read count of tests
*
* read request and print result
*/
int main(int argc, char **argv) {
if (argc < 1) {
std::cout << "You forgot to enter full path to file" << std::endl;
}
std::wifstream in_file(argv[1]);
if (!in_file.is_open()) {
std::cout << "Error with open" << std::endl;
return 0;
}
solution::Finder answer(in_file);
size_t n;
std::wcin >> n;
std::wstring request;
for (size_t i = 0; i < n; ++i) {
std::wcin >> request;
std::cout << answer.Find(request) << std::endl;
}
return 0;
}