2018年12月26日
摘要: void test01() { //构造方法 pair p1(10, 2); cout p2 = make_pair(10, "assd"); cout p3 = p2; } 阅读全文
posted @ 2018-12-26 17:59 likeghee 阅读(108) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; #include void printSet(set s) { for (set::iterator it = s.begin(); it != s.end(); it++) { cout s1;//初始化 s1.insert(1); s1.insert(65); s1.inse... 阅读全文
posted @ 2018-12-26 17:52 likeghee 阅读(410) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; #include void printList(list& mlist) { for (list::iterator it = mlist.begin(); it != mlist.end(); it++) { cout myList; list myList2(10, 1);//有参... 阅读全文
posted @ 2018-12-26 17:20 likeghee 阅读(133) 评论(0) 推荐(0) 编辑
摘要: #include #include //stack 不遍历 不支持随机访问 必须pop出去 才能进行访问 using namespace std; void test01() { //初始化 stack s1; stack s2(s1); //stack操作 //首先是压栈 s1.push(10); s1.push(20); ... 阅读全文
posted @ 2018-12-26 17:19 likeghee 阅读(123) 评论(0) 推荐(0) 编辑
摘要: //queue 一端插入 另一端删除 //不能遍历(不提供迭代器) 不支持随机访问 #include #include using namespace std; void test01() { queue q1; q1.push(10);//尾部插入 q1.push(20); q1.push(30); q1.pop();//删除队头 co... 阅读全文
posted @ 2018-12-26 17:19 likeghee 阅读(121) 评论(0) 推荐(0) 编辑
摘要: #include #include //deque容器 双口 using namespace std; void printDeque(deque& d) { for (deque::iterator it = d.begin(); it != d.end(); it++) { cout d; deque d2(10, 5); deque d3(... 阅读全文
posted @ 2018-12-26 17:18 likeghee 阅读(124) 评论(0) 推荐(0) 编辑