TP de C++
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

exercice2.cpp 458B

123456789101112131415161718192021222324252627282930313233
  1. #include <iostream>
  2. #include <list>
  3. using namespace std;
  4. int main(/*int argc, char const *argv[]*/)
  5. {
  6. list<char> l1;
  7. for(int i=65;i<65+10;i++){
  8. l1.push_back(i);
  9. cout << (char)i << endl;
  10. }
  11. cout << "Partie 2" << endl;
  12. list<char> l2=l1;
  13. list<char>::iterator ii=l2.begin();
  14. for(uint i=0;i<l2.size()/2;i++)ii++;
  15. l2.erase(l2.begin(), ii);
  16. for(list<char>::iterator it=l2.begin();it!=l2.end();it++){
  17. cout << *it << endl;
  18. }
  19. return 0;
  20. }