标签:ase puts std iter for int while begin return
#include <iostream> #include <list> using namespace std; int main(){ list<int> l; int a; while(cin>>a){ if(a==1){ int b,c; list<int>::iterator it=l.begin(); cin>>b>>c; for(int i=1;i<=b&&it!=l.end();i++,it++); l.insert(it,c); } if(a==2){ for(list<int>::iterator it=l.begin();it!=l.end();it++) cout<<*it<<‘ ‘; puts(""); } if(a==3){ int b; list<int>::iterator it=l.begin(); cin>>b; for(int i=1;i<=b;i++,it++); l.erase(it); } } return 0; }
标签:ase puts std iter for int while begin return
原文地址:http://www.cnblogs.com/HC-LittleJian/p/7533266.html