Sunday, November 4, 2012

String Reverse using Standard Template Library in C++


#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
string as;
int main()
{
    while(cin>>as){
        reverse(as.begin(),as.end());
        cout<<as<<endl;
    }
    return 0;
}


No comments:

Post a Comment