Advertisement
dllbridge

Untitled

Apr 16th, 2025
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 KB | None | 0 0
  1.  
  2. #include  <iostream>
  3. #include      <list>
  4. using namespace std;
  5.  
  6.  
  7.  
  8.  
  9. list<int>    L, l2, l3;
  10.  
  11.  
  12. ///////////////////////////////////////////////////
  13. int  main()
  14. {
  15.    
  16.     int sum = 0;
  17.    
  18.     for (int i = 0; i < 10; i++)    L .push_back(i + 100);
  19.     for (int i = 0; i < 30; i++)    l2.push_back(i);
  20.     for (int i = 0; i <  5; i++)    l3.push_back(i);
  21.    
  22.     list<int>::iterator it;
  23.    
  24.     it = L.begin();
  25.  
  26.     sum = *it;
  27.  
  28.     it++;
  29.  
  30.     cout << "sum = " << sum << endl;
  31.  
  32.     cout << "Size of L = " << L.size() << endl;
  33. }
  34.  
  35.  
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement