diff --git a/STL/STL-Deque/deque.exe b/STL/STL-Deque/deque.exe deleted file mode 100644 index 2a673f5..0000000 Binary files a/STL/STL-Deque/deque.exe and /dev/null differ diff --git a/STL/STL-List/main.exe b/STL/STL-List/main.exe deleted file mode 100644 index 9005809..0000000 Binary files a/STL/STL-List/main.exe and /dev/null differ diff --git a/STL/STL-Set/multiset.cpp b/STL/STL-Set/multiset.cpp new file mode 100644 index 0000000..082d354 --- /dev/null +++ b/STL/STL-Set/multiset.cpp @@ -0,0 +1,41 @@ +#include +#include //也是set +using namespace std; + +class compare{ +public: + template + bool operator()(const T& a, const T& b){ + return a > b; + } +}; + +int main(){ + auto cmpl = [](auto a, auto b){ + return a < b; + }; + multiset a{1,1,2,3,3,3,4,5,6,7,7,7,10}; + multiset b(cmpl); + b.insert({14,16,20,18,2,2,2,4,4,6,6,8,8,10,12}); + multiset c{1,3,5,7,9,11,11,11,13}; + for(int x : a){ + cout << x << " "; + }cout << endl; + for(int x : b){ + cout << x << " "; + }cout << endl; + for(int x : c){ + cout << x << " "; + }cout << endl; + cout << b.count(2) << endl; + cout << *b.upper_bound(6) << " " << *b.lower_bound(6) << endl; + return 0; +} +/* +1 1 2 3 3 3 4 5 6 7 7 7 10 +2 2 2 4 4 6 6 8 8 10 12 14 16 18 20 +13 11 11 11 9 7 5 3 1 +3 +8 6 +*/ +//基本用法与set一致,可以有多个重复元素 diff --git a/STL/STL-Set/set.exe b/STL/STL-Set/set.exe deleted file mode 100644 index 21ae0b7..0000000 Binary files a/STL/STL-Set/set.exe and /dev/null differ diff --git a/STL/STL-String/string.exe b/STL/STL-String/string.exe deleted file mode 100644 index 6e31086..0000000 Binary files a/STL/STL-String/string.exe and /dev/null differ diff --git a/STL/STL-Vector/define.exe b/STL/STL-Vector/define.exe deleted file mode 100644 index dcb818d..0000000 Binary files a/STL/STL-Vector/define.exe and /dev/null differ diff --git a/STL/STL-map/map.exe b/STL/STL-map/map.exe deleted file mode 100644 index 1fb09dc..0000000 Binary files a/STL/STL-map/map.exe and /dev/null differ