摘要: #include <iostream> using namespace std; #include <algorithm> #include <vector> //一、for_each()实现遍历容器 /* for_each(iterator beg, iterator end, _func) be 阅读全文
posted @ 2021-08-27 17:16 花与不易 阅读(64) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; #include <map> #include <algorithm> void printMap(const map<int, int>& mp) { for (auto it = mp.begin(); it != 阅读全文
posted @ 2021-08-27 14:57 花与不易 阅读(141) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; #include <set> #include <algorithm> void printSet(const set<int>& st) { for (auto it = st.begin(); it != st.e 阅读全文
posted @ 2021-08-27 13:41 花与不易 阅读(271) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; #include <string> #include <algorithm> //成对出现的数据,利用对组可以返回两个数据 /* 两种创建方式 pair<type, type> p(value1, value2); p 阅读全文
posted @ 2021-08-27 13:06 花与不易 阅读(42) 评论(0) 推荐(0)