Thu Nov 13, 2008 7:17 pm
#include <iostream>
#include <cassert>
#include <list>
#include <string>
#include <algorithm> // for reverse
using namespace std;
int main()
{
string s("asdfg");
list<char> list1(s.begin(), s.end());
list<char>::iterator i;
for (i = list1.begin(); i != list1.end(); ++i)
cout << *i;
reverse(list1.begin(), list1.end());
for (i = list1.begin(); i != list1.end(); ++i)
cout << *i;
return 0;
}
/*
asdfggfdsa
*/
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.