コンテナの複数ネスト

6046 ワード

//          ,   ,                      。       

//             。       ,  ,C++             。

//  ,          ,          ,     。             

//       。           。      ,       ,          





        ,          ,              。



    ,        ,         ,        ,   



             ,  ,            。         



          



class temp

{

      protected:

                

                vector  subject;      //  vector   

      public:

             

                int vec_return(int);       //    ,       。int           

};



int temp::vec_return (int a)                           //       , 



{

            

                 if ((a = 0))      //                    

                 {

                       return subject[a];

                 }

                 else

                 {

                     cout << "     "< name_sub;





vector          ,              ,      



              。



       ,name_sub[4] 5   。        ,



              



     



name_sub[4].vec_return(5);



。。。    。。      

 

#include 



#include 



using namespace std;





class temp

{

      protected:

                

                vector  subject;

      public:

             

                int  vec_return(int);       //    ,       。int           

                

                temp ()                     //     

                {

                                          

                     for (int i=0;  i<9;   i++)

                     {

                         subject.push_back(i);

                     }

                     

                } 

                

                             

                

};



int temp::vec_return (int a)                           //       , 



{

            

                 if ((a = 0))      //                    

                 {

                       return subject[a];

                 }

                 else

                 {

                     cout << "     "<  name_sub(10);

    

    cout << name_sub[4].vec_return(5)< subject;      //  list   

      public:

             

                temp ()                     //     

                {

                                          

                     for (int i=0;  i<9;   i++)

                     {

                         subject.push_back(i);

                     }

                     

                } 

                

                

                ~temp(){}

                

                int  list_return(int);    //    ,       。int

                                         //           

};



int  list_return(int a)                   //      

                                         //      ,list  ,          

                                         //  ,        ,         

{

      list ::iterator itr=subject.begin();

      

      

      

                      

      if ((a = 0))      //         

      {

         for (int i=0;  i!=a;  ++i)          //    ,          ; 

         {

             itr++;

         }

      }

      else                                   //       

      {

          cout << "    "<  name_subject;



 ,list       。        。。                





list ::iterator itr=name_subject.begin();





                ;



itr->list_return(6) 



  !     vector  ;



        !!!

 

#include 



#include 



using namespace std;



class temp

{

      protected:

                

                list  subject;      //  list   

      public:

             

                temp ()                     //     

                {

                                          

                     for (int i=0;  i<9;   i++)

                     {

                         subject.push_back(i);

                     }

                     

                } 

                

                

                ~temp(){}

                

                int  list_return(int);    //    ,       。int

                                         //           

};





int  temp::list_return (int a)            //      

                                         //      ,list  ,          

                                         //  ,        ,         

{

      list ::iterator itr=subject.begin();

      

      

      

                      

      if (a = 0)       //         

      {

         for (int i=0;  i!=a;  ++i)          //    ,          ; 

         {

             itr++;

         }

      }

      else                                   //       

      {

          cout << "    "< &name_sub,  int a,  int b)   //    ,                

                                                     //name_sub           

                                                     //int a       , int b       

{



      list ::iterator itr=name_sub.begin();    //       ;  

        

      if (a = 0)              //         

      {

   

                  

         for (int i=0;  i!=a;  ++i)                  //    ,          ; 

         {

             itr++;

         }

      }

      else                                           //       

      {

          cout << "    "<list_return(b);



}





int main()



{

    list  name_sub(10);

    

    

    cout << output(name_sub, 6,  4)<