TP_Cpp/TP2/exercice2.cpp

33 lines
458 B
C++
Raw Permalink Normal View History

2020-05-11 20:30:41 +02:00
#include <iostream>
#include <list>
using namespace std;
int main(/*int argc, char const *argv[]*/)
{
list<char> l1;
for(int i=65;i<65+10;i++){
l1.push_back(i);
cout << (char)i << endl;
}
cout << "Partie 2" << endl;
list<char> l2=l1;
list<char>::iterator ii=l2.begin();
for(uint i=0;i<l2.size()/2;i++)ii++;
l2.erase(l2.begin(), ii);
for(list<char>::iterator it=l2.begin();it!=l2.end();it++){
cout << *it << endl;
}
return 0;
}