关于c++ list容器的操作摸索

2015-07-24 06:00:45 · 作者: · 浏览: 11
#include
  
   
#include
   
     #include
    
      #include
     
       #include
      
        using namespace std; struct n1 { string name; long long num; }; list
       
        l; void charu() { n1 tmp; cin>>tmp.name>>tmp.num; if(tmp.num
        
         >xs; l.remove_if(way); } void shanxuehao() { cin>>xi; l.remove_if(way); } void xianshi() { list
         
          ::iterator i; for(i=l.begin();i!=l.end();i++) cout<
          
           name<<","<
           
            num<
            
>j; if(j==1) { cout<<"输入名字,学号(例如,杜甫 123):"< >j; if(j==1) shanmingzi(); else if(j==2) shanxuehao(); else if(j==3) quanshan(); } else if(j==3) { xianshi(); } else if(j==4) { cout<<"1.顺序 2.倒序"< >j; if(j==1) shunxu(); else if(j==2) daoxu(); cout<<"1.去重"< >j; if(j==1) l.unique(same_integral_part); } } int main() { int j; while(1) { xuanze(); cout<<"0.退出 1.返回选择界面"< >j; if(j==0) return 0; system("cls"); } }