#include<iostream>
#include<list>
#include<algorithm>
#include<iterator>
using namespace std;
int main()
{
int r[] ={10, 34, 58, 96, 5, 2};
list<int>ar(r, r+6);
list<int> :: iterator it;
it = find(ar.begin(), ar.end(), 58);
ar.insert(it, 69);
for(it=ar.begin(); it != ar.end(); it++)
{
cout << *it << "\t";
}
cout << endl;
return 0;
}
#include<list>
#include<algorithm>
#include<iterator>
using namespace std;
int main()
{
int r[] ={10, 34, 58, 96, 5, 2};
list<int>ar(r, r+6);
list<int> :: iterator it;
it = find(ar.begin(), ar.end(), 58);
ar.insert(it, 69);
for(it=ar.begin(); it != ar.end(); it++)
{
cout << *it << "\t";
}
cout << endl;
return 0;
}
Comments
Post a Comment