2021年10月20日
摘要: 一、概述 案例:C++ map集合练习测试 二、示例代码 #include <iostream> #include <map> using namespace std; void test(){ map<int,int> m; //第一种插入方式 m.insert(pair<int,int>(1,1 阅读全文
posted @ 2021-10-20 14:38 飘杨...... 阅读(248) 评论(0) 推荐(0)
摘要: 一、概述 案例:c++ stl之set集合练习 二、代码示例 #include <iostream> #include <set> #include <string> using namespace std; //打印set元素 void printSet(set<int> &s){ for(set 阅读全文
posted @ 2021-10-20 14:19 飘杨...... 阅读(106) 评论(0) 推荐(0)
摘要: 一、概述 案例:c++测试queue的用法 二、代码 #include <iostream> #include <queue> #include <string> using namespace std; class Person{ public: Person(string name,int ag 阅读全文
posted @ 2021-10-20 13:09 飘杨...... 阅读(74) 评论(0) 推荐(0)
摘要: 一、概述 栈:一个先进后出或者后进先出的集合,提供的方法有入栈出栈等操作。 案例:编写一个小案例将数据压入集合,然后不断拿到栈内元素。 二、示例图片 三、示例代码 #include <iostream> #include <stack> using namespace std; void print 阅读全文
posted @ 2021-10-20 11:28 飘杨...... 阅读(89) 评论(0) 推荐(0)
摘要: 一、概述 案例:有5名选手:选手ABCDE,10个评委分别对每一名选手打分,去除评委中最高分,去除评委中最低分,取平均分。 二、示例图片 三、示例代码 #include <iostream> #include <vector> #include <string> #include <deque> # 阅读全文
posted @ 2021-10-20 11:15 飘杨...... 阅读(64) 评论(0) 推荐(0)