Created
March 29, 2017 21:49
-
-
Save sebassdc/dcdffbd6f21bf5ea99d360b972841d8a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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