-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
32 lines (22 loc) · 678 Bytes
/
main.cpp
File metadata and controls
32 lines (22 loc) · 678 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
#include "dictionary.h"
#include <iostream>
int main() {
dictionary dict;
std::cout << dict << std::endl;
try {
dict.remove("axe");
dict.remove("123");
dict.remove("plane");
auto translations = dict.search("cool");
for (const auto& val: translations) {
std::cout << val << std::endl;
}
dict.search("plane");
} catch (std::runtime_error& error) {
std::cout << error.what() << std::endl;
}
dict.add("plane", std::vector<std::string> {"b777", "b787"});
dict.add("samsung", std::vector<std::string> {"a23", "a22"});
std::cout << dict << std::endl;
return 0;
}