Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<list>
- using namespace std;
- int main()
- {
- list<int>l1;
- list<int>l2;
- int n,x;
- cin>>n;
- for(int i=0;i<n;i++)
- { cin>>x;
- l1.push_back(x);
- }
- { cin>>x;
- l2.push_back(x);
- }
- list<int> ::iterator j;
- for(j=l1.begin();j!=l1.end();j++)
- {
- cout<<*j<<" ";
- }
- cout<<endl;
- // cout<<l1.front();
- // cout<<endl;
- // cout<<l1.back();
- j++;
- j++;
- j++;
- // l1.erase(j);*/
- //l1.insert(j,2,7);
- // l1.assign(l2.begin(),l2.end());
- for(j=l1.begin();j!=l1.end();j++)
- {
- cout<<*j<<" ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement