2021年8月15日
摘要: 1 //排序案列 2 //描述:将person自定义数据类型进行排序,Person中有属性 姓名,年龄,身高 3 //排序规则: 按照年龄进行的升序,如果年龄相同按照身高进行降序 4 5 #include<iostream> 6 #include<string> 7 #include<algorit 阅读全文
posted @ 2021-08-15 15:46 Bytezero! 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 1 //list容器 构造函数 //list赋值和交换 //list容器大小操作 2 //list插入和删除,移除 //清空 //list数据存取back(); front() 3 //list 反转和排序 4 #include<iostream> 5 #include<list> 6 #inclu 阅读全文
posted @ 2021-08-15 15:10 Bytezero! 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 1 //queue 队列 容器 先进先出 只有队头 队尾能被外界访问 因此不允许有遍历行为 2 3 4 #include<iostream> 5 #include<queue> 6 #include<string> 7 8 using namespace std; 9 10 class Person 阅读全文
posted @ 2021-08-15 13:00 Bytezero! 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 1 //栈 stack 容器 先进后出 不允许遍历 2 3 4 #include<iostream> 5 #include<stack> 6 7 using namespace std; 8 9 10 void test01() 11 { 12 //特点 先进后出数据结构 13 stack<int> 阅读全文
posted @ 2021-08-15 12:58 Bytezero! 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 1 #include<iostream> 2 #include<string> 3 #include<deque> 4 #include<vector> 5 #include<algorithm> 6 7 using namespace std; 8 9 //选手类 10 class Person 阅读全文
posted @ 2021-08-15 10:54 Bytezero! 阅读(52) 评论(0) 推荐(0) 编辑