Por ejemplo:
si se digitara: Hola Mundo
se debe devolver: Mundo Hola
...al q me pueda ayudar LAS GRACIAS. Por q ya me tiene loca ..no consigo el resultado!
![]() |
![]() |
|


#include <iostream.h>
#include <vector.h>
#include <string.h>
int main()
{
char str[] ="uno dos tres cuatro cinco";
char separator[] = " ";
char * token;
token = strtok (str, separator);
vector<char*> words;
while(token != NULL)
{
words.push_back(token);
token = strtok (NULL, separator);
}
while( !words.empty() ) {
cout << words.back() << endl;
words.pop_back();
}
system("PAUSE");
return 0;
}

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 0 invitados