1.7.    (STL)_________________________29

  init ()   stack<complex>   ;  
   .

1.7.    (STL)

   (Standard Template Library  STL) 
  C++,     -
       .
  :  ,   , , -
;        ;

         -
     . .     STL   
   ,  ,   ,  
    .

    ,    -
.      ,    -
    C++,   ,  . 
       STL.

  stl_list.cpp

//  list ()

#include <iostream>

^include <list>      // 

^include <numeric>   //   accumulate()

using namespace std;

void print(const list<double> &lst)
{ //     1st
list<double>::const_iterator where;

for (where = Ist.beginf); where i=lst.end(); ++where)
cout  *where  '\t';

cout  endl;

}

int main()
{

double w[4] = {0.9, 0.8, 88, -99.99};

list<double> z;

for( int i = 0; i < 4; ++i)
z.push_front(w[i]) ;

print(z) ;

z.sort() ;

print(z) ;

cout  "  " accumulate(z.begin(), z.end(), 0.0)
 endl;