Reverse A String by STL string

 string strValue; // STL string.
 cin >> strValue;
 strValue.replace(strValue.begin(), strValue.end(), strValue.rbegin(), strValue.rend());
 cout << strValue;

Please learn STL in deep!

posted @ 2008-06-27 15:58  能巴  阅读(386)  评论(0编辑  收藏  举报