-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cpp
More file actions
40 lines (32 loc) · 790 Bytes
/
test.cpp
File metadata and controls
40 lines (32 loc) · 790 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
#include <iostream>
#include <set>
#include <vector>
using namespace std;
void print(set<string> s) {
for (auto e : s) {
cout << e;
}
cout << endl;
}
int main() {
set<string> x = { "1", "24" };
set<string> y = { "1", "2", "3" };
cout << "x: ";
print(x);
cout << "y: ";
print(y);
cout << "int: ";
set<string> intersect;
set_difference(x.begin(), x.end(), y.begin(), y.end(), inserter(intersect, begin(intersect)));
print(intersect);
// vector<pair<int, int>> v = {
// {1, 1}, {1, 2}, {3, 4}
// };
// auto i = find(v.begin(), v.end(), pair<int, int>({-1, 2}));
// if (i == v.end()) {
// cout << "not found" << endl;
// } else {
// cout << "found" << endl;
// }
return 0;
}