anonymous / gist:3888140
Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View gist:3888140
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#include <iostream>
#include <string>
#include <deque>
using namespace std;
 
int main()
{
const string str = "Hello world";
const int len = str.length();
string s = "";
deque<char> temp;
 
for (int i = 0; i < len; i++)
temp.push_front(str[i]);
 
for (int i = 0; i < len; i++)
s += temp[i];
 
cout << "Original: " << str << endl;
cout << "Reversed: " << s << endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.