Skip to content

Instantly share code, notes, and snippets.

@sebassdc
Created March 29, 2017 21:49
Show Gist options
  • Save sebassdc/dcdffbd6f21bf5ea99d360b972841d8a to your computer and use it in GitHub Desktop.
Save sebassdc/dcdffbd6f21bf5ea99d360b972841d8a to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
string reverse(string cadena) {
string alveres;
for (int i = cadena.length() -1; i >= 0; i--){
cout << "f " << i << endl;
alveres += cadena.at(i);
}
return alveres;
}
main() {
cout << "Esta es el string normal: " << endl;
string s = "String de prueba";
cout << s << endl;
cout << "El string al reves: " << endl;
cout << reverse(s) << endl; // Aqui se llama a la funcion
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment