摘要: #include <list> void printList(const list<int>& L) { for (list<int>::const_iterator it = L.begin(); it != L.end(); it++) { cout << *it << " "; } cout 阅读全文
posted @ 2021-09-27 14:57 健丽 阅读(37) 评论(0) 推荐(0) 编辑
摘要: #include <queue> #include <string> class Person { public: Person(string name, int age) { this->m_Name = name; this->m_Age = age; } string m_Name; int 阅读全文
posted @ 2021-09-27 14:21 健丽 阅读(26) 评论(0) 推荐(0) 编辑
摘要: #include <stack> //栈容器常用接口 void test01() { //创建栈容器 栈容器必须符合先进后出 stack<int> s; //向栈中添加元素,叫做 压栈 入栈 s.push(10); s.push(20); s.push(30); while (!s.empty()) 阅读全文
posted @ 2021-09-27 09:35 健丽 阅读(46) 评论(0) 推荐(0) 编辑
摘要: #include <deque> void printDeque(const deque<int>& d) { for (deque<int>::const_iterator it = d.begin(); it != d.end(); it++) { cout << *it << " "; } c 阅读全文
posted @ 2021-09-27 09:12 健丽 阅读(37) 评论(0) 推荐(0) 编辑