list

 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;

 

posted @ 2020-06-03 21:51  安之若醇  阅读(111)  评论(0编辑  收藏  举报
Live2D服务支持