1 #include
2 #include
3 #include
4 #include
5 using namespace std;
6
7 int main()
8 {
9 list ilist,ilist2,ilist3;
10 for(list::size_type i=0;i!=4;i++)
11 ilist.push_front(i);
12 copy(ilist.begin(),ilist.end(),front_inserter(ilist2));
13 copy(ilist.begin(),ilist.end(),inserter(ilist3,ilist3.begin()));
14 copy(ilist.begin(),ilist.end(),ostream_iterator(cout," "));
15 cout< 16 copy(ilist2.begin(),ilist2.end(),ostream_iterator(cout," "));
17 cout< 18 copy(ilist3.begin(),ilist3.end(),ostream_iterator(cout," "));
19 cout< 20 }
阅读(594) | 评论(0) | 转发(0) |