list

时间:2020-06-03 22:44:06   收藏:0   阅读:59
 1  list<int> ll;
 2     ll.push_back(12);// 在末尾添加元素
 3     ll.push_front(10);// 在开头添加元素
 4     ll.back();// 读取末尾元素
 5     ll.front();// 读取开头元素
 6     ll.push_back(12);
 7     ll.unique();// 删除重复元素
 8     cout<<ll.size()<<endl;
 9     ll.pop_front();// 在末尾删除元素
10     ll.pop_back();// 在开头删除元素
11 
12     return 0;

 

原文:https://www.cnblogs.com/zhmlzhml/p/13040277.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!