字符串逆置
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
void reverseString(string &s)
{
	int i, j;
	for (i = 0, j = s.size() - 1; i < j; ++i, --j)
	{
		swap(s[i], s[j]);
	}
}
int main()
{
	string str;
	while(cin>>str) {
	reverseString(str);
	cout << str;
	system("pause");
		}
	return 0;
}

 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号